Skip to content
Snippets Groups Projects
Commit ba3ae0af authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Store scrollback position before clearing screen at end.

This allows ALT-B from dialing directory to show the last seen
thing, not the extra blank screen added to the end.

Doesn't fix anything, but a huge QoL improvement for people who use
ALT-B after disconnecting.
parent 7c441878
No related branches found
No related tags found
No related merge requests found
Pipeline #5837 passed
......@@ -384,7 +384,7 @@ viewofflinescroll(void)
setfont(0, false, 4);
drawwin();
set_modepalette(palettes[COLOUR_PALETTE]);
top = scrollback_lines;
top = scrollback_pos;
gotoxy(1, 1);
textattr(uifc.hclr | (uifc.bclr << 4) | BLINK);
gettextinfo(&sbtxtinfo);
......
......@@ -137,6 +137,7 @@ struct syncterm_settings settings;
char *font_names[sizeof(conio_fontdata) / sizeof(struct conio_font_data_struct)];
struct vmem_cell *scrollback_buf = NULL;
unsigned int scrollback_lines = 0;
unsigned int scrollback_pos = 0;
unsigned int scrollback_mode = C80;
unsigned int scrollback_cols = 80;
int safe_mode = 0;
......
......@@ -87,6 +87,7 @@ extern struct vmem_cell *scrollback_buf;
extern uint32_t *scrollback_fbuf;
extern uint32_t *scrollback_bbuf;
extern unsigned int scrollback_lines;
extern unsigned int scrollback_pos;
extern unsigned int scrollback_mode;
extern unsigned int scrollback_cols;
extern struct syncterm_settings settings;
......
......@@ -3771,6 +3771,7 @@ doterm(struct bbslist *bbs)
uifcmsg("Disconnected",
"`Disconnected`\n\nRemote host dropped connection");
check_exit(false);
scrollback_pos = cterm->backpos;
cterm_clearscreen(cterm, cterm->attr); /* Clear screen into
* scrollback */
scrollback_lines = cterm->backpos;
......@@ -4130,6 +4131,7 @@ doterm(struct bbslist *bbs)
"Selecting Yes closes the connection\n")) {
freescreen(savscrn);
setup_mouse_events(&ms);
scrollback_pos = cterm->backpos;
cterm_clearscreen(cterm, cterm->attr); /* Clear screen into
* scrollback */
scrollback_lines = cterm->backpos;
......@@ -4161,6 +4163,7 @@ doterm(struct bbslist *bbs)
j = wherey();
switch (syncmenu(bbs, &speed)) {
case -1:
scrollback_pos = cterm->backpos;
cterm_clearscreen(cterm, cterm->attr); /* Clear screen into
* scrollback */
scrollback_lines = cterm->backpos;
......@@ -4204,6 +4207,7 @@ doterm(struct bbslist *bbs)
break;
case 12:
#endif
scrollback_pos = cterm->backpos;
cterm_clearscreen(cterm, cterm->attr); /* Clear screen into
* scrollback */
scrollback_lines = cterm->backpos;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment