Skip to content
Snippets Groups Projects
Commit 31a06efc authored by deuce's avatar deuce
Browse files

Add ALT-S as shotcut to scrollback for *nix (Not sure if getch() should work

the same way on Win32)
Add shotcut key info to online menu
Many scrollback viewing save/restore the screen
parent 3236e194
No related branches found
No related tags found
No related merge requests found
...@@ -9,11 +9,16 @@ void viewscroll(void) ...@@ -9,11 +9,16 @@ void viewscroll(void)
int top; int top;
int key; int key;
int i; int i;
char *buf;
struct text_info txtinfo;
uifcbail(); uifcbail();
gettextinfo(&txtinfo);
buf=(char *)malloc(txtinfo.screenheight*txtinfo.screenwidth*2);
gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf);
drawwin(); drawwin();
top=term.backpos-term.height; top=term.backpos-term.height;
for(;;) { for(i=0;!i;) {
if(top<1) if(top<1)
top=1; top=1;
if(top>term.backpos-term.height) if(top>term.backpos-term.height)
...@@ -42,6 +47,7 @@ void viewscroll(void) ...@@ -42,6 +47,7 @@ void viewscroll(void)
top+=term.height; top+=term.height;
break; break;
case ESC: case ESC:
i=1;
return; return;
case KEY_F(1): case KEY_F(1):
init_uifc(); init_uifc();
...@@ -56,12 +62,20 @@ void viewscroll(void) ...@@ -56,12 +62,20 @@ void viewscroll(void)
break; break;
} }
} }
puttext(1,1,txtinfo.screenwidth,txtinfo.screenheight,buf);
free(buf);
return;
} }
int syncmenu(void) int syncmenu(void)
{ {
char *opts[3]={ "Scrollback" char *opts[3]={
,"Disconnect" #ifdef __unix__
"Scrollback (ALT-S)"
#else
"Scrollback"
#endif
,"Disconnect (CTRL-Q)"
,""}; ,""};
int opt=0; int opt=0;
int i; int i;
......
...@@ -647,6 +647,12 @@ void doterm(void) ...@@ -647,6 +647,12 @@ void doterm(void)
case KEY_F(4): case KEY_F(4):
rlogin_send("\033Ox",3,100); rlogin_send("\033Ox",3,100);
break; 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 KEY_BACKSPACE:
case '\b': case '\b':
key='\b'; key='\b';
...@@ -656,6 +662,7 @@ void doterm(void) ...@@ -656,6 +662,7 @@ void doterm(void)
ch[0]=key; ch[0]=key;
rlogin_send(ch,1,100); rlogin_send(ch,1,100);
} }
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment