Handler for CSI P (delete characters at cursor)

This commit is contained in:
Michael Jumper 2011-08-10 09:31:12 -07:00
parent f9d42c7182
commit 52e14322a3

View File

@ -418,7 +418,7 @@ int ssh_guac_terminal_csi(ssh_guac_terminal* term, char c) {
break;
/* L: Delete lines (scroll up) */
/* M: Delete lines (scroll up) */
case 'M':
amount = argv[0];
@ -429,6 +429,28 @@ int ssh_guac_terminal_csi(ssh_guac_terminal* term, char c) {
break;
/* P: Delete characters (scroll left) */
case 'P':
amount = argv[0];
if (amount == 0) amount = 1;
/* Scroll left by amount */
if (term->cursor_col + amount < term->term_width)
ssh_guac_terminal_copy(term,
term->cursor_row, term->cursor_col + amount,
1,
term->term_width - term->cursor_col - amount,
term->cursor_row, term->cursor_col);
/* Clear right */
ssh_guac_terminal_clear(term,
term->cursor_row, term->term_width - amount,
1, amount,
term->background);
break;
/* Warn of unhandled codes */
default:
if (c != ';')