d23f15cd3f29f1ab2de0771df92aa0d30893f64e
Although our use of ANSI codes here is rather simple it is generally good practice to use terminfo in order to be portable to different terminal emulators. Vendor github.com/Nvveen/Gotty (actually my fork with a fix, see https://github.com/Nvveen/Gotty/pull/1) and use that to parse the terminfo files. Note that "\e]2K" (clear entire line) is not covered by terminfo. We can achieve the same end by first clearing from begining of line to cursor (el1="\e]1K") and then clearing from cursor to end of line (el="\e]k"). Test suite has been updated and forces (either directly or by setting $TERM to something highly unlikely to exist) the use of the non-terminfo fallbacks which retains the same output behaviour as previously. This is preferable even to relying on a well-known and relatively static terminfo (like vt102) since even that in principal might have different terminfo encodings. In case terminfo is not available at all for $TERM or doesn't expose the specific capabilities which we use then fall back to the previous manual escapes, with the exception that we avoid "\e]2K" as discussed above. Tested with a manual docker pull with rxvt-unicode ($TERM=rxvt-unicode), xterm ($TERM=xterm), mlterm ($TERM=mlterm) and aterm ($TERM=kterm). Signed-off-by: Ian Campbell <ian.campbell@docker.com> Upstream-commit: f02221a7941948017df68db8fd9a5de7f19453bf Component: engine
Description
No description provided
Languages
Go
92%
Shell
5.5%
Dockerfile
1.1%
Go-Checksums
0.9%
Makefile
0.3%
Other
0.2%