#930037 irssi + mosh: badly rendered status lines

Package:
mosh
Source:
mosh
Description:
Mobile shell that supports roaming and intelligent local echo
Submitter:
Jakub Wilk
Date:
2019-10-02 19:42:03 UTC
Severity:
normal
#930037#3
Date:
2019-06-05 19:07:16 UTC
From:
To:
After a stretch→buster upgrade, the blue status lines in Irssi are no
longer displayed correctly; see the attached screenshots.

This seems to happen only under mosh.

Downgrading ncurses-base base to the stretch version
(6.0+20161126-1+deb9u2) fixes it for me.

#930037#8
Date:
2019-06-05 22:57:00 UTC
From:
To:
A "typescript" from the "script" program would show what escape sequences
irrsi is using when producing the problematic image.

Looking at its source-code, I have a hunch the problem is in that program ;-)
It's nominally a terminfo application, so it seems the only places to look
are the terminal description and the (mis)use irrsi makes of it.

(also, it would help to know what $TERM is - I see it also checks $TMUX)

#930037#11
Date:
2019-06-05 22:57:00 UTC
From:
To:
A "typescript" from the "script" program would show what escape sequences
irrsi is using when producing the problematic image.

Looking at its source-code, I have a hunch the problem is in that program ;-)
It's nominally a terminfo application, so it seems the only places to look
are the terminal description and the (mis)use irrsi makes of it.

(also, it would help to know what $TERM is - I see it also checks $TMUX)

#930037#16
Date:
2019-06-06 14:27:16 UTC
From:
To:
    Hey.

 what's yout TERM on the host, when you mosh to the server?  Is there
any tmux or screen involved?  Are both the server from which you mosh
out of and the remote server buster?  Or does a mosh to localhost work
there?

 This might be related: https://github.com/irssi/irssi/issues/753

 Thanks for additional information,
Rhonda

#930037#19
Date:
2019-06-06 16:56:05 UTC
From:
To:
* Rhonda D'Vine <rhonda@deb.at>, 2019-06-06, 16:27:

Terminal on the local side doesn't seem to matter; I can reproduce the
bug in any of the following:
* Linux console (TERM=linux)
* urxvt (TERM=rxvt)
* xterm (TERM=xterm)

On the remote server, it's TERM=xterm.

No.

The local machine is unstable.

Aha, thanks. I guess mosh's xterm emulation isn't quite right...

Irssi upstream recommends setting TERM to something else on the server
side, but AFAIK there's no dedicated terminal definition for mosh. :-/

I've set TERM=vte (even though mosh and VTE are unrelated) as a
work-around for now; it fixes the bug and I haven't seen any bad side
effects so far.

#930037#22
Date:
2019-06-06 17:08:59 UTC
From:
To:
* Thomas Dickey <dickey@his.com>, 2019-06-05, 18:57:

Attached.

#930037#27
Date:
2019-06-07 08:13:12 UTC
From:
To:
 Glad this helped.  I noticed a few strangenesses with respect to mosh
instead of ssh myself, like certain utf8 characters not getting
displayed, which was kinda weird.  I think there is a bit fishy stuff
going on in mosh, unsure if it might be related to different mosh
versions on both ends (but both buster and unstable have the same, so
that's not the case here), but it certainly mixes some bits up.

 Are you fine with closing this bugreport then?  I am more leaning
towards that it might be mosh in play here than irssi, we could also
reassign?

 Thanks,
Rhonda

#930037#32
Date:
2019-06-07 08:49:32 UTC
From:
To:
The only difference that I see is that in the "bad" one,
it's using cursor movement rather than blanks.
--- good_6.0+20161126-1+deb9u2.typescript.txt 2019-06-07 04:28:27.000000000 -0400 +++ bad_6.1+20181013-2.typescript.txt 2019-06-07 04:28:28.000000000 -0400 @@ -1,6 +1,7 @@ -Script started on 2019-06-06 17:03:16+00:00 [TERM="xterm" TTY="/dev/pts/1" COLUMNS="89" LINES="29"] +Script started on 2019-06-06 17:00:17+00:00 [TERM="xterm" TTY="/dev/pts/0" COLUMNS="89" LINES="29"] \n \E[?1049h +\E[22;0;0t \E[?1h \E= \E[?25l @@ -17,7 +18,8 @@ \E[37m \E[44m \E[?25l -\E[1;1H +\E[1;1H +\E[88b \E[1;1H \E[29;1H \E[?12l @@ -28,7 +30,7 @@ \E[27m \E[23m \E[?25l -\E[2;1H17:03 +\E[2;1H17:00 \E[34m \E[1m- \E(B @@ -44,7 +46,7 @@ \E[27m \E[23m ___ _ \E[K -\E[3;1H17:03 +\E[3;1H17:00 \E[34m \E[1m- \E(B @@ -60,7 +62,7 @@ \E[27m \E[23m |_ _|_ _ _____(_) \E[K -\E[4;1H17:03 +\E[4;1H17:00 \E[34m \E[1m- \E(B @@ -76,7 +78,7 @@ \E[27m \E[23m | || '_(_-<_-< | \E[K -\E[5;1H17:03 +\E[5;1H17:00 \E[34m \E[1m- \E(B @@ -92,7 +94,7 @@ \E[27m \E[23m |___|_| /__/__/_| \E[K -\E[6;1H17:03 +\E[6;1H17:00 \E[34m \E[1m- \E(B @@ -159,12 +161,14 @@ \E[37m \E[44m \E[?25l -\E[1;1H +\E[1;1H +\E[88b \E[1;1H Irssi v1.2.0-2 - https://irssi.org -\E[28;1H +\E[28;1H +\E[88b \E[28;1H \E[36m[ -\E[37m17:03 +\E[37m17:00 \E[36m] \E[37m \E[36m[] @@ -187,7 +191,7 @@ \E[?25l \E[28;1H \E[36m[ -\E[37m17:03 +\E[37m17:00 \E[36m] \E[29;12H \E[?12l @@ -219,7 +223,8 @@ \E[23m \E[29;1H \E[?1049l +\E[23;0;0t \E[?1l \E> -\nScript done on 2019-06-06 17:03:18+00:00 [COMMAND_EXIT_CODE="0"] +\nScript done on 2019-06-06 17:00:49+00:00 [COMMAND_EXIT_CODE="0"] \n
#930037#35
Date:
2019-08-02 16:25:11 UTC
From:
To:
This happens because mosh doesn't implement the repetition operator (see
bug #933053).

Minimal reproducer:

   $ printf 'mo\33[5b\n'
   mo

But in xterm proper it is:

   $ printf 'mo\33[5b\n'
   moooooo

#930037#46
Date:
2019-10-02 19:39:07 UTC
From:
To:
Control: forwarded -1 https://github.com/mobile-shell/mosh/issues/1064

Thanks.  Meanwhile it has also been reported upstream.

Cheers,
       Sven