Skip to content

Commit a5a9100

Browse files
committed
Merge patch branch changes to main.
2 parents 2aabe28 + 8651022 commit a5a9100

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

src/terminal/select.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static void guac_terminal_clipboard_append_row(guac_terminal* terminal,
298298
end = buffer_row->length - 1;
299299

300300
/* Get position of last not null char */
301-
for (eol = buffer_row->length; eol > start; eol--) {
301+
for (eol = buffer_row->length - 1; eol > start; eol--) {
302302

303303
if (buffer_row->characters[eol].value != 0)
304304
break;

src/terminal/terminal-handlers.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,32 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) {
840840

841841
break;
842842

843+
/* S: Scroll Up by amount */
844+
case 'S':
845+
846+
/* Get move amount */
847+
amount = argv[0];
848+
if (amount == 0) amount = 1;
849+
850+
/* Scroll up */
851+
guac_terminal_scroll_up(term, term->scroll_start,
852+
term->scroll_end, amount);
853+
854+
break;
855+
856+
/* T: Scroll Down by amount */
857+
case 'T':
858+
859+
/* Get move amount */
860+
amount = argv[0];
861+
if (amount == 0) amount = 1;
862+
863+
/* Scroll Down */
864+
guac_terminal_scroll_down(term, term->scroll_start,
865+
term->scroll_end, amount);
866+
867+
break;
868+
843869
/* X: Erase characters (no scroll) */
844870
case 'X':
845871

src/terminal/terminal.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,10 @@ int guac_terminal_scroll_up(guac_terminal* term,
10141014
end_row - amount + 1, 0,
10151015
end_row, term->term_width - 1);
10161016

1017+
/* Flush display copy before the cursor commit override operation
1018+
* type for visible cursor row and breaks display. */
1019+
guac_terminal_display_flush(term->display);
1020+
10171021
return 0;
10181022
}
10191023

@@ -1027,6 +1031,10 @@ int guac_terminal_scroll_down(guac_terminal* term,
10271031
start_row, 0,
10281032
start_row + amount - 1, term->term_width - 1);
10291033

1034+
/* Flush display copy before the cursor commit override operation
1035+
* type for visible cursor row and breaks display. */
1036+
guac_terminal_display_flush(term->display);
1037+
10301038
return 0;
10311039
}
10321040

0 commit comments

Comments
 (0)