diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2017-01-12 16:28:29 +0100 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2017-04-06 11:27:27 +0200 |
commit | a48e1f96dc329cd0fc28ed91890dd19f4d12a47c (patch) | |
tree | 62712d6533eba9313751f3d7f0f0e968f50b9a39 /src | |
parent | 565b8901cad828d921038cd6235501c42d1c9a32 (diff) | |
download | screen-a48e1f96dc329cd0fc28ed91890dd19f4d12a47c.tar.gz |
fix restoring cursor position after leaving altscreen
When swapping to altscreen, also swap cursor position
Bug: 49883
Diffstat (limited to 'src')
-rw-r--r-- | src/ansi.c | 2 | ||||
-rw-r--r-- | src/resize.c | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -1149,8 +1149,8 @@ static void DoCSI(Window *win, int c, int intermediate) } } else { if (win->w_alt.on) { - RestoreCursor(win, &win->w_alt.cursor); LeaveAltScreen(win); + RestoreCursor(win, &win->w_alt.cursor); } } if (a1 == 47 && !i) diff --git a/src/resize.c b/src/resize.c index a6a741e..0dc032d 100644 --- a/src/resize.c +++ b/src/resize.c @@ -798,6 +798,14 @@ static void SwapAltScreen(Window *p) SWAP(width, t); SWAP(height, t); + /* we need to swap cursor positions, but they are not swappable with macro */ + t = p->w_alt.cursor.x; + p->w_alt.cursor.x = p->w_x; + p->w_x = t; + t = p->w_alt.cursor.y; + p->w_alt.cursor.y = p->w_y; + p->w_y = t; + SWAP(histheight, t); SWAP(hlines, ml); SWAP(histidx, t); |