st was assuming that save/restore cursor position was independent
of the screen that was shown in each moment, but it is not true,
because each screen has a different save/restore buffer. This
patch fixes it.
+ static TCursor c[2];
+ bool alt = IS_SET(MODE_ALTSCREEN);
if(mode == CURSOR_SAVE) {
if(mode == CURSOR_SAVE) {
} else if(mode == CURSOR_LOAD) {
} else if(mode == CURSOR_LOAD) {
- term.c = c;
- tmoveto(c.x, c.y);
+ term.c = c[alt];
+ tmoveto(c[alt].x, c[alt].y);
case 1034:
MODBIT(term.mode, set, MODE_8BIT);
break;
case 1034:
MODBIT(term.mode, set, MODE_8BIT);
break;
- case 1049: /* = 1047 and 1048 */
- case 47:
+ case 1049: /* swap screen & set/restore cursor as xterm */
+ tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
+ case 47: /* swap screen */
case 1047:
if (!allowaltscreen)
break;
case 1047:
if (!allowaltscreen)
break;
alt = IS_SET(MODE_ALTSCREEN);
if(alt) {
tclearregion(0, 0, term.col-1,
alt = IS_SET(MODE_ALTSCREEN);
if(alt) {
tclearregion(0, 0, term.col-1,