GUACAMOLE-564: Merge changes ignoring APC sequences within Guacamole's terminal emulator.
This commit is contained in:
commit
526152b9c6
@ -186,5 +186,16 @@ int guac_terminal_osc(guac_terminal* term, unsigned char c);
|
|||||||
*/
|
*/
|
||||||
int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c);
|
int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles terminal control function sequences initiated with "ESC _".
|
||||||
|
*
|
||||||
|
* @param term
|
||||||
|
* The terminal that received the given character of data.
|
||||||
|
*
|
||||||
|
* @param c
|
||||||
|
* The character that was received by the given terminal.
|
||||||
|
*/
|
||||||
|
int guac_terminal_apc(guac_terminal* term, unsigned char c);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -367,6 +367,10 @@ int guac_terminal_escape(guac_terminal* term, unsigned char c) {
|
|||||||
guac_terminal_reset(term);
|
guac_terminal_reset(term);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case '_':
|
||||||
|
term->char_handler = guac_terminal_apc;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
guac_client_log(term->client, GUAC_LOG_DEBUG,
|
guac_client_log(term->client, GUAC_LOG_DEBUG,
|
||||||
"Unhandled ESC sequence: %c", c);
|
"Unhandled ESC sequence: %c", c);
|
||||||
@ -1373,3 +1377,19 @@ int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int guac_terminal_apc(guac_terminal* term, unsigned char c) {
|
||||||
|
|
||||||
|
/* xterm does not implement APC functions and neither do we. Look for the
|
||||||
|
* "ESC \" (string terminator) sequence, while ignoring other chars. */
|
||||||
|
static bool escaping = false;
|
||||||
|
|
||||||
|
if (escaping) {
|
||||||
|
if (c == '\\')
|
||||||
|
term->char_handler = guac_terminal_echo;
|
||||||
|
escaping = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == 0x1B)
|
||||||
|
escaping = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user