Random control characters output to screen in tmux

271 views
Skip to first unread message

Thomas Furfaro

unread,
Aug 18, 2017, 10:30:19 AM8/18/17
to powerline
Hi,

Just recently I started having trouble with powerline and tmux. For whatever reason, some string is regularly output to the terminal (once every ~10 seconds or so when I don't have focus, more if I'm interacting with the terminal). In gnome-terminal, I see some control characters and then a `q`. On konsole, it seems to filter out the control characters and just print `q`. If I stop the daemon and use tmux without it, there are no problems. If I disable powerline (remove from tmux config and kill daemon), the problem goes away.

$ qq

My .tmux.conf just calls the default config (from pip):
set -g mouse-utf8 off

set -g default-terminal "xterm-256color"

set -s escape-time 0

run-shell "powerline-daemon -q"
source "$HOME/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"

$HOME/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf:
if-shell 'env "$POWERLINE_CONFIG_COMMAND" tmux setup' '' 'run-shell "powerline-config tmux setup"'
# vim: ft=tmux

$ lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
$ konsole --version
Qt: 4.8.6
KDE Development Platform: 4.13.3
Konsole: 2.13.2
$ pip show powerline-status
Name: powerline-status
Version: 2.6.dev9999+git.bc1713d58bb2484087c1b5ebeffc9256af0bbf4b
Summary: The ultimate statusline/prompt utility.
Author: ______
Author-email: ________
License: MIT
Location: __$HOME___/.local/lib/python2.7/site-packages
Requires: 
$ gnome-terminal --version
GNOME Terminal 3.10.2

Any insight on how to debug this would be appreciated,

Tom F.

Nikolay Aleksandrovich Pavlov

unread,
Aug 18, 2017, 11:37:56 AM8/18/17
to Thomas Furfaro, powerline
I have seen similar issue when using Konsole + Neovim: depending on
Neovim version its cursor shaping setting may trigger `q` output in
place of changing cursor shape. When triggered, output persists up
until you kill the terminal.

The problem is that powerline is not doing any cursor shaping, neither
it is setting tmux mouse options, also this specific cursor shaping
bug was never observed in gnome-terminal AFAIR.

Some questions:

- Which tmux version?
- What if you run `powerline-daemon --replace --foreground` in a
separate terminal, not inside tmux? Does the problem persist, what is
printed in that terminal if there is anything?
- What control characters exactly? Can you show a screenshot, and are
they always the same?
- Does the problem persist if you remove `set -g mouse-utf8 off`?
- Does the problem persist if you replace `set -g escape-time 0` with
`set -g escape-time 10`? (Do not forget to restart tmux server after
both edits.)
> --
> You received this message because you are subscribed to the Google Groups
> "powerline" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to powerline-supp...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Thomas Furfaro

unread,
Aug 21, 2017, 5:07:04 AM8/21/17
to Nikolay Aleksandrovich Pavlov, powerline
Thanks for the quick reply.

I'm now trying to be more thorough about how I test this, and your comment about neovim made me try completely disabling powerline and just using tmux + neovim to see what would happen. (In neovim I'm not using powerline.) Indeed, the problem is reliably reproducible by opening tmux, then neovim inside a clean session, and then quitting back to the tmux shell. So, it's not a powerline issue. I think before it was obfuscated because I assumed neovim wasn't a contributor to the problem.

I will pursue this with the neovim/tmux crowd, thanks for the hint.

You received this message because you are subscribed to a topic in the Google Groups "powerline" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/powerline-support/oxlqveXcVms/unsubscribe.
To unsubscribe from this group and all its topics, send an email to powerline-supp...@googlegroups.com.

Michael Ellery

unread,
Sep 3, 2017, 10:00:43 AM9/3/17
to powerline, zyx...@gmail.com


On Monday, August 21, 2017 at 2:07:04 AM UTC-7, Thomas Furfaro wrote:
Thanks for the quick reply.

I'm now trying to be more thorough about how I test this, and your comment about neovim made me try completely disabling powerline and just using tmux + neovim to see what would happen. (In neovim I'm not using powerline.) Indeed, the problem is reliably reproducible by opening tmux, then neovim inside a clean session, and then quitting back to the tmux shell. So, it's not a powerline issue. I think before it was obfuscated because I assumed neovim wasn't a contributor to the problem.

I will pursue this with the neovim/tmux crowd, thanks for the hint.


Hi Thomas,

Did you find any resolution to this issue or do you have link to on open issue that tracks it? I think I'm seeing the same behavior with tmux 2.5 and NVIM 0.2.1-dev. Thanks.

-Mike

Thomas Furfaro

unread,
Sep 4, 2017, 7:08:36 AM9/4/17
to Michael Ellery, powerline, zyx...@gmail.com
Hi Mike,

I chased this problem for a bit and there are a lot of purported solutions, but the only thing that worked for me was adding:

if has('nvim')
  set guicursor= 
endif

to my .vimrc/init.vim. 

See https://github.com/neovim/neovim/issues/6005 and https://github.com/neovim/neovim/wiki/FAQ#cursor-shape-doesnt-change-in-tmux. You lose a little functionality with this fix, but it was good enough for me.

Hope that helps,

Tom




Michael Ellery

unread,
Sep 4, 2017, 12:17:16 PM9/4/17
to Thomas Furfaro, powerline, zyx...@gmail.com

Perfect - seems like a good workaround for now. Thanks for your reply and links to the issues.

-Mike

Reply all
Reply to author
Forward
0 new messages