Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Blinking text with ls --color=auto? #500

Closed
PaBLoX-CL opened this Issue · 12 comments

7 participants

@PaBLoX-CL

I just started to try mosh, and I found something weird, running ls --color=auto results in a weird colored blinking text. Any other tools (like vim and tmux for ie), seems to work fine. I have been searching, but I can't seem to find any reference to this issue. Any clue what could be causing it?

@keithw
Owner

What version of mosh-client are you running on the client, what version of mosh-server are you running on the server, what is the outer terminal emulator (xterm? PuTTY?), what is the TERM environment variable before you run mosh, and what is the TERM environment variable on the server after you mosh in?

Also, are you running any tools like screen or tmux, or just mosh?

@PaBLoX-CL

Sorry, I'm adding the info now.

I am using the same mosh version, 1.2.4 for the client and for the server (version available trough the arch linux package manager)
I am using urxvt, on my local machine.

  • The $TERM is rxvt-unicode,
  • After mosh in (or using ssh), the $TERM continue to be rxvt-unicode,
  • If I go inside tmux, colors get messed, but the ls command stops the blink.

I was looking at the dircolors command, and I found if a set this one that doesn't work at all and results on the blinking. Guess this it's not an issue with mosh then?

@keithw
Owner

Hmm, are you able to replicate the problem with xterm or gnome-terminal / xfce4-terminal?

@PaBLoX-CL

Ok, I tried those:

xterm and urxvt reproduce the issue, vte based emulators don't (sakura, xfce4-terminal, ecc).

@andersk
Collaborator
  • After mosh in (or using ssh), the $TERM continue to be rxvt-unicode,

This may be part of the problem. Mosh is different from ssh in this respect: Mosh sets the inner TERM value to xterm (or xterm-256color, if supported by the initial outer terminal), and it needs this value to be preserved, for the reasons described in my comments on #446.

Are you modifying the TERM value in your dotfiles? If you stop doing that, does the problem go away?

@mark7

I can also reproduce this behavior. It's caused by my non-standard dircolors file, but still, mosh should probably deal with the escape sequences the same way that tmux/screen/xterm/etc do.

TERM both client and server-side is xterm-256color.

mosh on both ends is 1.2.4a. mosh-client -c returns 256.

The colortest- commands present in Debian and Ubuntu run without problems.

Once screen is invoked on the remote end (which I have set up to report xterm-256color, so it should not be changing ls behavior), ls output looks fine in mosh.

This can be produced in bash, cutting terminfo and similar out of the picture, by running:

echo -e '\e[00;38;5;2mfoo\e[0m'

My dircolors is based on (as I suspect PaBLoX-CL's is) https://lists.gnu.org/archive/html/bug-coreutils/2007-09/msg00127.html

It appears that mosh treats the ";5" portion of the escape code as adding the blink attribute, whereas screen, tmux, urxvt, etc do not. I have not walked through the escape code standards to check what the appropriate thing to do with ;5 is, but compatibility with the other common terminal types is probably desirable, whether-or-not this is officially the standard.

@mark7

PaBLoX-CL: The escape codes in that dircolors should probably have the leading "00;" removed from them; removing them eliminates the blinking for me.

mosh should still probably interpret the codes, valid or not, as the other terminal emulators do, but that may get you working without trouble.

@PaBLoX-CL

Since that issue I haven't been using mosh, but I tried again, I'm using

https://github.com/seebi/dircolors-solarized

Paricularly, 256dark, here's is a screenshot comparing both, and also $TERM variable. I dunno why mosh changes it.

2014-08-26-131035_1366x768_scrot

@ghazel

I also see blinking text, in man pages (the pager is less).

Terminal.app $TERM is xterm-256color
in the mosh session, the remote machine also has $TERM of xterm-256color

@chr4

+1, same issue here

@chr4

I think I found the issue:
When using tmux/ screen, the terminals TERM variable is screen-256color instead of xterm-256color. When using export TERM=xterm-256color, it works from inside tmux as well as without tmux.

Without deeper knowledge of how mosh works, could it be that this piece of code runs on the server and should match the TERM variable on the client?
https://github.com/keithw/mosh/blob/50152bfcba872dd2ef5318877823005ad0c4593f/src/examples/termemu.cc#L106

@cgull
Collaborator

@PaBLoX-CL, your issue is almost certainly fixed by #507-- the dircolors file you link to has the issue that's fixed in that PR. If you want, please try building and installing mosh from the master branch here, on both client and server. I think you'll find your problem fixed. Closing this issue for now.

@chr4, no, that code (and the similar code in mosh-server.cc, which is what's really relevant) is correct. Mosh is a virtual terminal emulator in its own right, just as screen/tmux are, and must set TERM=xterm, which is the terminal it most closely resembles.

@cgull cgull closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.