diff --git a/src/syncterm/menu.c b/src/syncterm/menu.c index 5bbd74ff1835cc168aeda6626e2f272a1b1a3853..8a3dd0fbae13093cc50a1504b12e5cfc39faaa88 100644 --- a/src/syncterm/menu.c +++ b/src/syncterm/menu.c @@ -9,11 +9,16 @@ void viewscroll(void) int top; int key; int i; + char *buf; + struct text_info txtinfo; uifcbail(); + gettextinfo(&txtinfo); + buf=(char *)malloc(txtinfo.screenheight*txtinfo.screenwidth*2); + gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf); drawwin(); top=term.backpos-term.height; - for(;;) { + for(i=0;!i;) { if(top<1) top=1; if(top>term.backpos-term.height) @@ -42,6 +47,7 @@ void viewscroll(void) top+=term.height; break; case ESC: + i=1; return; case KEY_F(1): init_uifc(); @@ -56,12 +62,20 @@ void viewscroll(void) break; } } + puttext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf); + free(buf); + return; } int syncmenu(void) { - char *opts[3]={ "Scrollback" - ,"Disconnect" + char *opts[3]={ +#ifdef __unix__ + "Scrollback (ALT-S)" +#else + "Scrollback" +#endif + ,"Disconnect (CTRL-Q)" ,""}; int opt=0; int i; diff --git a/src/syncterm/term.c b/src/syncterm/term.c index 9fb1564b714862dd49e766a09b7626b7c68c3e14..640222aaf6953f3820aea9941a177fc3d0f98079 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -647,6 +647,12 @@ void doterm(void) case KEY_F(4): rlogin_send("\033Ox",3,100); break; +#ifdef __unix__ + case 128|'S': /* Under curses, ALT sets the high bit of the char */ + case 128|'s': /* Under curses, ALT sets the high bit of the char */ + viewscroll(); + break; +#endif case KEY_BACKSPACE: case '\b': key='\b'; @@ -656,6 +662,7 @@ void doterm(void) ch[0]=key; rlogin_send(ch,1,100); } + } } }