gnome-terminal randomly outputs control characters

Bug #1435905 reported by Bruno Beltran
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned
terminator (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Observed behavior:
When using tmux, the terminal occasionally displays the "boxed" version of the 0x001b character followed by two ']' characters either in the cursor's current location or at the end of a refreshed line, or sometimes at an apparently random position on the screen. The times at which this character appears seem to be completely random.

To reproduce:
Get a clean install of tmux and gnome-terminal from the repositories. It is difficult to quantify this, but it appears that the bug will present itself most readily when working in vim or another refresh-heavy cli program.

Why it's not a tmux bug:
The bug appears to affect gnome-terminal and terminator, but not xterm or e.g. sessions connected over putty. In fact, if I open all of these screens side-by-size (using a virtual machine), and simultaneously attach to the same tmux session, only gnome-terminal and terminator show the strange characters, while the other two terminals render the screen as expected.

Please see this superuser discussion for a link to a video of what the bug looks like:
http://superuser.com/questions/864364/tmux-printing-u0x001b-and-112-randomly

Let me know if there is anything else I can do to help reproduce/solve this, as using xterm is a really bad workaround to have to put up with.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: gnome-terminal 3.6.2-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-43.72-generic 3.13.11.11
Uname: Linux 3.13.0-43-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.7
Architecture: amd64
Date: Tue Mar 24 10:30:12 2015
InstallationDate: Installed on 2015-01-11 (71 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
ProcEnviron:
 LANGUAGE=en_US
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-terminal
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Bruno Beltran (brunobeltran0) wrote :
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Could you please get a(n as short as possible) script(1) log of this behavior?

Gnome-terminal handles unknown escape sequences worse than other emulators. We'd need to understand whether tmux emits something incorrect, or gnome-terminal (actually vte) just doesn't understand that sequence.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Looks from that other bugreport that it's OSC 112 causing a problem. Support for this escape sequence was added to vte-0.35.2 which appeared in Utopic.

Revision history for this message
Bruno Beltran (brunobeltran0) wrote :

I am attaching a log.

After some trial and error, I was able to set up my terminal in a state such that I could reproduce the error in a single keystroke.

The transcript of the session is:
$ script -f /home/$USER/bin/shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log
Script started, file is /home/bbeltr1/24-Mar-15_13-29-44_shell.log
$ tmux attach
[vim renders]
[I hit <ctrl-q>j, to change to the (non-existent) "next lower" tmux pane]
[the character appears in my vim status line]
[I hit <ctrl-q>d to detach]
$ Ctrl^D

I should also point out that if I resize the window before I detach, the character disappears, presumedly because vim re-renders the status line. More in general, any action which re-renders that character on the screen will cause the glitch-character to disappear.

Thank you for the quick response!

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Okay, there's indeed an OSC 112 (that is: \e ] 112 \a) in the output.

You could try installing the libvte-2.90-9 package from Utopic (and then restart all gnome-terminal instances), I'm pretty certain this would fix your problem. (I hope it doesn't have dependency problems.)

(I'm not giving this piece of advice on Ubuntu's behalf and it's not my decision if they'll backport the fix to Trusty. I'm keeping an eye on mainstream gnome-terminal/vte, where this bug is most likely alrady fixed.)

Revision history for this message
Bruno Beltran (brunobeltran0) wrote :

Edmont's suggestion worked: i.e. updating to the latest version of libvte fixed the problem in both gnome-terminal and terminator.

Revision history for this message
Steven (nemesissre) wrote :

In Vivid where libvte-2.90-9 is default there error only appears in terminator, gnome-terminal is working.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Changed in terminator (Ubuntu):
status: New → Confirmed
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Vivid ships 3 parallel versions of vte:
libvte9 0.28.x - used by Gtk2 apps such as terminator, xfce4-terminal
libvte-2.90-9 0.36.x - a tiny bit older than the newest, used by e.g. roxterm-gtk3
libvte-2.91-0 0.38.x - the newest, used by e.g. gnome-terminal

As stated above, the bug was fixed in 0.35.x, so apps using either of the two new versions of vte should be fine.

Revision history for this message
atomi (atomi-g) wrote :

Similar thing happens when using an escape sequence to change cursor color ie. echo -ne "\e]12;orange1\a". on Gnome Terminal 3.6.2 (and RoxTerm too) but only when attached to a tmux session. xterm escape sequence for cursor colors works with or without tmux.

Attached shows character and 112 sequence occurring in Gnome Terminal using tmux.

Revision history for this message
atomi (atomi-g) wrote :

"xterm escape sequence for cursor colors works with or without tmux."

I meant the actual xterm terminal here.

Revision history for this message
atomi (atomi-g) wrote :

I solved my issue by overriding Cr in tmux as gnome-terminal for whatever reason does not support \033]112\007

set-option -g terminal-overrides ',xterm*:Cr=\E]12;gray\007'

https://github.com/tmux/tmux/issues/266

Revision history for this message
Bruno Beltran (brunobeltran0) wrote : Re: [Bug 1435905] Re: gnome-terminal randomly outputs control characters

A better solution is to upgrade libvte
On Jan 13, 2016 7:15 PM, "atomi" <email address hidden> wrote:

> I solved my issue by overriding Cr in tmux as gnome-terminal for
> whatever reason does not support \033]112\007
>
> set-option -g terminal-overrides ',xterm*:Cr=\E]12;gray\007'
>
> https://github.com/tmux/tmux/issues/266
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1435905
>
> Title:
> gnome-terminal randomly outputs control characters
>
> Status in gnome-terminal package in Ubuntu:
> Confirmed
> Status in terminator package in Ubuntu:
> Confirmed
>
> Bug description:
> Observed behavior:
> When using tmux, the terminal occasionally displays the "boxed" version
> of the 0x001b character followed by two ']' characters either in the
> cursor's current location or at the end of a refreshed line, or sometimes
> at an apparently random position on the screen. The times at which this
> character appears seem to be completely random.
>
> To reproduce:
> Get a clean install of tmux and gnome-terminal from the repositories. It
> is difficult to quantify this, but it appears that the bug will present
> itself most readily when working in vim or another refresh-heavy cli
> program.
>
> Why it's not a tmux bug:
> The bug appears to affect gnome-terminal and terminator, but not xterm
> or e.g. sessions connected over putty. In fact, if I open all of these
> screens side-by-size (using a virtual machine), and simultaneously attach
> to the same tmux session, only gnome-terminal and terminator show the
> strange characters, while the other two terminals render the screen as
> expected.
>
> Please see this superuser discussion for a link to a video of what the
> bug looks like:
>
> http://superuser.com/questions/864364/tmux-printing-u0x001b-and-112-randomly
>
> Let me know if there is anything else I can do to help reproduce/solve
> this, as using xterm is a really bad workaround to have to put up
> with.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 14.04
> Package: gnome-terminal 3.6.2-0ubuntu1
> ProcVersionSignature: Ubuntu 3.13.0-43.72-generic 3.13.11.11
> Uname: Linux 3.13.0-43-generic x86_64
> ApportVersion: 2.14.1-0ubuntu3.7
> Architecture: amd64
> Date: Tue Mar 24 10:30:12 2015
> InstallationDate: Installed on 2015-01-11 (71 days ago)
> InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64
> (20140722.2)
> ProcEnviron:
> LANGUAGE=en_US
> PATH=(custom, no user)
> XDG_RUNTIME_DIR=<set>
> LANG=en_US.UTF-8
> SHELL=/bin/bash
> SourcePackage: gnome-terminal
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1435905/+subscriptions
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.