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?
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?
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.
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?
Hmm, are you able to replicate the problem with xterm or gnome-terminal / xfce4-terminal?
Ok, I tried those:
xterm and urxvt reproduce the issue, vte based emulators don't (sakura, xfce4-terminal, ecc).
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?
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.
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.
Since that issue I haven't been using mosh, but I tried again, I'm using
Paricularly, 256dark, here's is a screenshot comparing both, and also $TERM variable. I dunno why mosh changes it.
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
+1, same issue here
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?
@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.