diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-12-16 20:33:22 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-12-16 20:33:22 +0000 |
| commit | f4e5baa123990053df9e1e0746e2e2d4d76b6c92 (patch) | |
| tree | 8738768bd1d614ea9d55c9cb38fe8e834e7c0ae9 /terminal.c | |
| parent | term: disable cursor blink before shutting down terminal, and remove from FDM (diff) | |
term: disable cursor blink on unfocus, and re-enable on focus
Diffstat (limited to 'terminal.c')
| -rw-r--r-- | terminal.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -1326,17 +1326,25 @@ term_restore_cursor(struct terminal *term) void term_focus_in(struct terminal *term) { - if (!term->focus_events) - return; - term_to_slave(term, "\033[I", 3); + if (term->cursor_blink.active) + cursor_blink_start_timer(term); + + if (term->focus_events) + term_to_slave(term, "\033[I", 3); + + cursor_refresh(term); } void term_focus_out(struct terminal *term) { - if (!term->focus_events) - return; - term_to_slave(term, "\033[O", 3); + if (term->cursor_blink.active) + cursor_blink_stop_timer(term); + + if (term->focus_events) + term_to_slave(term, "\033[O", 3); + + cursor_refresh(term); } static int |
