Hi,
attached is a patch, that adds support for the deprecated '\E[?47h' and
'\E[?47l' control sequences, which are used when $TERM == "xterm-color".
I've also added {rm,sm}cup entries to st.info, so that switching between
normal and alternate screen now works when $TERM == "st[-256color]".
I would also like to look into the scrollback buffer goal. How do you
want to achieve an unlimited scrollback buffer? Writing every line to a
file and printing its content instead of the current buffer when
scrolling back? What are the cons to just having a fixed amount of lines
(simply a bigger Line *line), memmoving them when input arrives and
normally displaying only the row-1 last ones?
Bert
diff -r 2effc50d2c4f st.c
--- a/st.c Sun May 22 16:57:27 2011 +0200
+++ b/st.c Wed Jun 01 09:44:01 2011 +0200
@@ -1116,6 +1116,10 @@
case 25:
term.c.state |= CURSOR_HIDE;
break;
+ case 47:
+ if (IS_SET(MODE_ALTSCREEN))
+ tswapscreen();
+ break;
case 1000: /* disable X11 xterm mouse reporting */
term.mode &= ~MODE_MOUSE;
break;
@@ -1182,6 +1186,10 @@
case 25:
term.c.state &= ~CURSOR_HIDE;
break;
+ case 47:
+ if (!IS_SET(MODE_ALTSCREEN))
+ tswapscreen();
+ break;
case 1000: /* enable X11 xterm mouse reporting */
term.mode |= MODE_MOUSE;
break;
diff -r 2effc50d2c4f st.info
--- a/st.info Sun May 22 16:57:27 2011 +0200
+++ b/st.info Wed Jun 01 09:44:01 2011 +0200
@@ -82,6 +82,7 @@
rev=\E[7m,
ri=\EM,
rmacs=\E(B,
+ rmcup=\E[?1049l,
rmso=\E[m,
rmul=\E[m,
sc=\E7,
@@ -90,6 +91,7 @@
sgr0=\E[0m,
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
smacs=\E(0,
+ smcup=\E[?1049h,
smso=\E[7m,
smul=\E[4m,
tbc=\E[2g,