4

I ssh/mosh into two servers with the same settings (to my best knowledge).

However, when the output is in inverted color (background color <=> front color) on server A, it's shown as italic font on B. This happens to all built in command. For example,

cal

enter image description here

The current date shows in inverted color, but in server B:

enter image description here

I have tried hard to figure out what's the difference between the two servers but no avail.

It seems not related to my ssh, centos or terminal (zsh) settings.

4

2 Answers 2

8

The "inverted color" is the terminal's standout capability, normally done using reverse-video (colors don't matter). A program running in screen may send the escape sequence for standout, but screen program happens to interpret the standard escape sequence for italics as the standout feature. So it sends italics.

If you're not actually using screen, you're using some program which copied that (mis)feature.

Addressing a comment: tmux began by using the terminal description designed for GNU screen, which has this italics sequence as the standout capability. Later versions of tmux look first for a description designed for tmux. You can see the feature using infocmp:

$ infocmp screen tmux    
comparing screen to tmux.
    comparing booleans.
    hs: F:T.
    comparing numbers.
    ncv: NULL, NULL.
    comparing strings.
    dsl: NULL, '\E]0;\007'.
    fsl: NULL, '^G'.
...
    kri: NULL, '\E[1;2A'.
    ritm: NULL, '\E[23m'.
    rmso: '\E[23m', '\E[27m'.
    sgr: '\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;m%?%p9%t\016%e\017%;', '\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;'.
    sitm: NULL, '\E[3m'.
    smso: '\E[3m', '\E[7m'.
    tsl: NULL, '\E]0;'.

smso is the standout capability, while sitm and ritm set/reset italics.

1
  • my term is screen-256color and it seems that TMUX changed the behavior after version 2.x -> 3.0 Commented Jul 2, 2020 at 1:05
0

Check the TERM environment variable on both servers.

Check the corresponding setting in the terminal application if you are using saved profiles for different connections.

Not the answer you're looking for? Browse other questions tagged .