dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 87177861f90bb1c6cdf5c4b2282716723ccc599d
parent d6b37effbab3e2cefae3fec3aef4778b07396752
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 19 Dec 2014 22:20:57 +0100

Support \e[?10{47,48,49}{h,l} sequences

These were introduced by xterm to switch between normal and
alternate screen buffers. According to the documentation

 \e[1047 should switch the buffers
 \e[1048 should save/restore the cursor
 \e[1049 should do both

However dvtm currently associates the cursor state with the
buffer therefore a buffer switch will always restore the previous
cursor state of that buffer.

This is not standard comformant but so far did not expose any
show stopper bugs?

Also switching to the alternate buffer should clear it.

vt.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/vt.c b/vt.c @@ -947,9 +947,17 @@ static void interpret_csi_priv_mode(Vt *t, int param[], int pcount, bool set) t->curshid = !set; break; case 47: /* use alternate/normal screen buffer */ + case 1047: + case 1049: t->buffer = set ? &t->buffer_alternate : &t->buffer_normal; vt_dirty(t); break; + case 1048: + if (set) + cursor_save(t); + else + cursor_restore(t); + break; case 1000: /* enable/disable normal mouse tracking */ t->mousetrack = set; break;