]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
vt: detect and ignore OSC codes.
authorAdam Borowski <kilobyte@angband.pl>
Wed, 19 Feb 2014 00:38:04 +0000 (01:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Mar 2014 00:25:47 +0000 (16:25 -0800)
commit63f3a16db915096d7a80a96748adba00feb07a32
tree131d7ba0b5809848aa71728b107b57d3e54fd28d
parentb290af68de57196e7cb34805f41cd3416ed1a791
vt: detect and ignore OSC codes.

These can be used to send commands consisting of an arbitrary string to the
terminal, most often used to set a terminal's window title or to redefine
the colour palette.  Our console doesn't use OSC, unlike everything else,
which can lead to junk being displayed if a process sends such a code
unconditionally.

The rules for termination follow established practice rather than Ecma-48.
Ecma-48 requires the string to use only byte values 0x08..0x0D and
0x20..0x7E, terminated with either ESC \ or 0x9C.  This would disallow using
8-bit characters, which are reasonable for example in window titles.
A widespread idiom is to terminate with 0x07.  The behaviour for other
control characters differs between terminal emulators, I followed libvte and
xterm:
* 0x07 and ESC anything terminate
* nothing else terminates, all 8-bit values including 0x9C are considered a
  part of the string

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c