diff options
author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-11-08 17:15:26 +0100 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-11-08 17:15:26 +0100 |
commit | 950ff21e17af487b205ea0b666be015790114fa7 (patch) | |
tree | 6c49ad8a200751177aca627fab8621ef9da24209 /st.c | |
parent | 5d39afc9023bc9a692ba6faf590abf9397a890ae (diff) | |
download | st-950ff21e17af487b205ea0b666be015790114fa7.tar.gz st-950ff21e17af487b205ea0b666be015790114fa7.zip |
Fix bug restoring cursor position
Sequences like DECSC, DECRC, ESC [?1047l or ESC [?1047h save and restore
cursor attributes, than taken from vt100 manual are:
Save Cursor (DECSC) ESC 7
===========================
Saves the following in terminal memory.
- cursor position
- graphic rendition
- character set shift state
- state of wrap flag
- state of origin mode
Restore Cursor (DECRC) ESC 8
===========================
Restores the states described for (DECSC) above. If none of these
characteristics were saved, the cursor moves to home position; origin
mode is reset; no character attributes are assigned; and the default
character set mapping is established.
This implies that hide attribute of the cursor should not be saved/restored
in these sequences. The best way to fix this problem is moving hide
attribute into the terminal mode, instead of having it in the cursor state.
---
st.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -96,8 +96,7 @@ enum cursor_movement { | |||
96 | 96 | ||
97 | enum cursor_state { | 97 | enum cursor_state { |
98 | CURSOR_DEFAULT = 0, | 98 | CURSOR_DEFAULT = 0, |
99 | CURSOR_HIDE = 1, | 99 | CURSOR_WRAPNEXT = 1, |
100 | CURSOR_WRAPNEXT = 2 | ||
101 | }; | 100 | }; |
102 | 101 | ||
103 | enum glyph_state { | 102 | enum glyph_state { |
@@ -115,7 +114,8 @@ enum term_mode { | |||
115 | MODE_MOUSEMOTION = 64, | 114 | MODE_MOUSEMOTION = 64, |
116 | MODE_MOUSE = 32|64, | 115 | MODE_MOUSE = 32|64, |
117 | MODE_REVERSE = 128, | 116 | MODE_REVERSE = 128, |
118 | MODE_KBDLOCK = 256 | 117 | MODE_KBDLOCK = 256, |
118 | MODE_HIDE = 512 | ||
119 | }; | 119 | }; |
120 | 120 | ||
121 | enum escape_state { | 121 | enum escape_state { |
@@ -1464,8 +1464,8 @@ tsetmode(bool priv, bool set, int *args, int narg) { | |||
1464 | case 0: /* Error (IGNORED) */ | 1464 | case 0: /* Error (IGNORED) */ |
1465 | case 12: /* att610 -- Start blinking cursor (IGNORED) */ | 1465 | case 12: /* att610 -- Start blinking cursor (IGNORED) */ |
1466 | break; | 1466 | break; |
1467 | case 25: | 1467 | case 25: /* DECTCEM -- Text Cursor Enable Mode */ |
1468 | MODBIT(term.c.state, !set, CURSOR_HIDE); | 1468 | MODBIT(term.mode, !set, MODE_HIDE); |
1469 | break; | 1469 | break; |
1470 | case 1000: /* 1000,1002: enable xterm mouse report */ | 1470 | case 1000: /* 1000,1002: enable xterm mouse report */ |
1471 | MODBIT(term.mode, set, MODE_MOUSEBTN); | 1471 | MODBIT(term.mode, set, MODE_MOUSEBTN); |
@@ -2505,7 +2505,7 @@ xdrawcursor(void) { | |||
2505 | } | 2505 | } |
2506 | 2506 | ||
2507 | /* draw the new one */ | 2507 | /* draw the new one */ |
2508 | if(!(term.c.state & CURSOR_HIDE)) { | 2508 | if(!(IS_SET(MODE_HIDE))) { |
2509 | if(!(xw.state & WIN_FOCUSED)) | 2509 | if(!(xw.state & WIN_FOCUSED)) |
2510 | g.bg = defaultucs; | 2510 | g.bg = defaultucs; |
2511 | 2511 | ||