GNOME Bugzilla – Bug 548272
[PATCH] Fix output of CSI 13,14, 18-21
Last modified: 2009-01-28 03:48:01 UTC
this report has been filed here: https://bugs.edge.launchpad.net/ubuntu/+source/vte/+bug/208837 "The escape sequence "Esc [ 1 8 t" is meant to make the terminal reply with the height and width of the current window characters. It's handled in vte-0.16.9/src/vteseq.c, line 3865. The output on gnome-terminal is different to the xterm from xterm-229-1. Here's the correct, xterm, behaviour. $ echo -n '^[[18t'; sleep 1; echo ^[[8;24;80t $ And the gnome-terminal: $ echo -n '^[[18t' ; sleep 1; echo ^[[24;80t $ There should be an "8;" before the height of 24. This in theory allows the string to be echoed back to the terminal to restore this size in the future. As well as xterm providing different behaviour, I've found various references on the Internet, e.g. http://invisible-island.net/xterm/ctlseqs/ctlseqs.html, which also suggest vte is wrong." "The ^[ seen in the single quotes in my examples is a literal escape character typed as `Ctrl-V Escape'. If xterm is giving `^[[18t' back then that suggests a circumflex and open bracket have been given. Try echo -n '@[18t' | tr @ \\033; sleep 1; echo instead which can be cut-and-pasted. This uses tr(1) to turn the `@' into an ASCII ESC." Thanks,
Ubuntu bug #208837 lists other problems in later comments; I'd recommend referring to it. In particular, "There are other similar faults where the response is incorrect in that same function. ^[[13t response should be ^[[3;x;yt but is ^[[x;yt. ^[[14t response should be ^[[4;h;wt but is ^[[h;wt. ^[[19t response should be ^[[9;h;wt but is ^[[h;wt. On a similar note, although ^[[20t is handled correctly in responding with the icon's label, the response to ^[[21t also outputs an `L' when it should be using a lowercase `l'. The above URL and xterm confirm lowercase `l' for 21 is the correct behaviour."
Created attachment 126009 [details] [review] 0001-tweak-CSI-13-14-18-19-20-21.patch Fixes the output for CSI 13, 14, 18, 19. Changes the output of CSI 20, 21 to use the real terminal titles (and fixes the case issue).
ChPe, Chris, how does this look?
This looks ok to me, comparing with the control sequence reference link provided in comment 0.
Please commit if it compiles ;).
Just compiled before checking in, just to be on the safe side :-).