On Tue, Nov 08, 2016 at 04:02:53PM +0000, Ian Campbell <[email protected]> 
wrote:
> This was reported to docker https://github.com/docker/docker/issues/281
> 11 when doing a docker pull there is a multi-line scrolling progress
> bar, when running under rxvt-unicode the final line is duplicated.

Ok, after analyzing it, docker relies on undocumented behaviour in xterm.
Basically, docker does "move cursor 0 lines up" and expects the terminal
to move up one line, which xterm does, but urxvt doesn't. To try it out,
run this near the bottom line of the screen:

   printf "\n\n\e[0B\e[0A---"

(Try with a plain shell prompt when unsure)

This will leave the --- (and the prompt) in the last line of the screen
with urxvt, and in the second to last line with xterm.

rxvt-unicode here behaves as specified in the ANSI standard, while xterm
(probably) interprets the 0 as missing parameter.

I think docker should at the very least use an ANSI csi here (For
portability), or, as I said before, since terminals differ widely, better
employ terminfo or curses, as to not hardcode the wrong sequences and/or
quirks in terminals (for example, the provided log fails even more
spectacularly in rxvt, something I suspect would not happen when not
hardcoding xterm sequences).

That is, a quick fix is to use use \e[A or \e[1A to move up a line. Even
better would be to not output \e[0[A (B, C...) sequences at all, as it is
clearly outside of defined behaviour with common terminals, and you can't
rely on standards such as ANSI as existing ermianls and emulators do not
follow it closely enough for it to work.

(If docker uses some kind of library already, then it should not pass
explicit 0 to cursor movement commands, as xterm and other terminals do
not interpret 0 as 0).

In summary: docker outputs a lot of "move cursor 0 characters" commands,
which are undocumented, non-ANSI, and behave different in different
terminals.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/rxvt-unicode

Reply via email to