-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Summary
This is a feature request for the cli to automatically pick up the hosts TERM
environment variable and assign it to the container when starting with -t
(tty) flag. I.e. in effect implicitly add -e TERM=${TERM}
to the command line arguments when -t
is present.
The current situation is to apply a default of value xterm
in the engine, and this is clearly documented.
Justification
When running an interactive container from the command line its possible for the cli to pick up the correct TERM
value and assign it to ensure any text editors, tools that use readline, ncurses, etc, work correctly out of the box - this should not affect the default defined in the engine that seems reasonable.
For me, I use tmux
so often find small issues with key bindings due to the default of xterm
.
$ echo ${TERM}
screen-256color
$ docker run -t -i --rm alpine:latest /bin/sh -c 'echo ${TERM}'
xterm
$ docker run -t -i --rm -e TERM=${TERM} alpine:latest /bin/sh -c 'echo ${TERM}'
screen-256color
I see two possible concerns:
- Running older containers might not support the same as that used on the host, esp. w.r.t. the
-256color
. - Security risk of implicitly using a host's environment variable. E.g. running an older container that is vulnerable to something like shellshock.