diff options
author | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-04-03 00:52:53 -0400 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-04-03 00:52:53 -0400 |
commit | f95352946080be803b794c9f2733d8c809c1a39a (patch) | |
tree | 8b458cd585c4b54295fdff356ff844ada1315afa /src/resize.c | |
parent | d6e9eb25e92e548f86ffd78a604022c47303aacc (diff) | |
download | screen-f95352946080be803b794c9f2733d8c809c1a39a.tar.gz |
Improve cursor store/restore on smcup/rmcup.
When going to alternate screen buffer on smcup, the terminal is
supposed to store the cursor position, rendition etc. Screen used to
store only the position (and that was just a little buggy anyway).
So change this behaviour to store all information about the cursor,
and restore everything on rmcup.
Apparently, the terminal is supposed to store the cursor for smcup
(CSI ? 1049 h) and DECSC (ESC 7, CSI s, CSI ? 1048 h) separately. So
be it.
Diffstat (limited to 'src/resize.c')
-rw-r--r-- | src/resize.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/resize.c b/src/resize.c index 0f24ca5..ec67a7a 100644 --- a/src/resize.c +++ b/src/resize.c @@ -976,6 +976,10 @@ int wi, he, hi; p->w_saved.y = 0; if (p->w_saved.y >= he) p->w_saved.y = he - 1; + if (p->w_alt.cursor.x > wi) + p->w_alt.cursor.x = wi; + if (p->w_alt.cursor.y >= he) + p->w_alt.cursor.y = he - 1; /* reset scrolling region */ p->w_top = 0; @@ -1043,8 +1047,6 @@ struct win *p; p->w_alt.mlines = 0; p->w_alt.width = 0; p->w_alt.height = 0; - p->w_alt.x = 0; - p->w_alt.y = 0; #ifdef COPY_PASTE if (p->w_alt.hlines) { @@ -1071,8 +1073,6 @@ struct win *p; SWAP(width, t); SWAP(height, t); SWAP(histheight, t); - SWAP(x, t); - SWAP(y, t); #ifdef COPY_PASTE SWAP(hlines, ml); @@ -1085,7 +1085,6 @@ void EnterAltScreen(p) struct win *p; { - int ox = p->w_x, oy = p->w_y; if (!p->w_alt.on) { /* If not already using the alternate screen buffer, then create @@ -1101,8 +1100,6 @@ struct win *p; p->w_histheight = 0; } ChangeWindowSize(p, p->w_alt.width, p->w_alt.height, p->w_alt.histheight); - p->w_x = ox; - p->w_y = oy; p->w_alt.on = 1; } |