oscHandler function
OSC - Operating System Command: sequence starting with ESC ] (7bit) or OSC (\x9D, 8bit)
Implementation
bool oscHandler(Queue<int> queue, Terminal terminal) {
final params = _parseOsc(queue, terminal.platform.oscTerminators);
if (params == null) {
return false;
}
terminal.debug.onOsc(params);
if (params.isEmpty) {
terminal.debug.onError('osc with no params');
return true;
}
if (params.length < 2) {
return true;
}
final ps = params[0];
final pt = params[1];
switch (ps) {
case '0':
case '2':
terminal.onTitleChange(pt);
break;
case '1':
terminal.onIconChange(pt);
break;
default:
terminal.debug.onError('unknown osc ps: $ps');
}
return true;
}