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

Add backscroll buffer (Still no way of actually SEEING it though)

parent ca491ca5
Branches
Tags
No related merge requests found
......@@ -37,6 +37,12 @@ void scrollup(void)
char *buf;
int i,j;
term.backpos++;
if(term.backpos>backlines) {
memmove(term.scrollback,term.scrollback+term.width*2,term.width*2*(backlines-1));
term.packpos--;
}
gettext(term.x+1,term.y+1,term.x+term.width,term.y+1,term.scrollback+(term.backpos-1)*term.width*2);
buf=(char *)malloc(term.width*(term.height-1)*2);
gettext(term.x+1,term.y+2,term.x+term.width,term.y+term.height,buf);
puttext(term.x+1,term.y+1,term.x+term.width,term.y+term.height-1,buf);
......@@ -492,12 +498,13 @@ void doterm(void)
term.escbuf[0]=0;
term.sequence=0;
term.music=0;
term.backpos=0;
term.scrollback=malloc(term.width*2*backlines);
ch[1]=0;
/* Main input loop */
gotoxy(term.xpos,term.ypos);
textattr(term.attr);
_setcursortype(_NORMALCURSOR);
/* Main input loop */
for(;;) {
/* Get remote input */
i=rlogin_recv(ch,1,100);
......@@ -586,8 +593,10 @@ void doterm(void)
/* Get local input */
if(kbhit()) {
key=getch();
if(key==17)
if(key==17) {
free(term.scrollback);
return;
}
if(key<256) {
ch[0]=key;
rlogin_send(ch,1,100);
......
......@@ -15,6 +15,8 @@ struct terminal {
char escbuf[1024];
int sequence;
int music;
char *scrollback;
int backpos;
};
extern struct terminal term;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment