I am able to start a command line interface (CLI) for a distinct docker container from within Docker Desktop:
If I press an arrow key inside the console window, strange character codes are shown, e.g. if I press the up key, instead of showing the last command, the characters "^[[A" are shown:
=> How can I permanently adapt the shell command?
I tried to set SHELL=/bin/bash
in the system environment variables to use bash
instead sh
but that did not help.
Related:
docker exec bash in windows - keyboard arrow keys don't work
For support of arrow keys one needs bash
instead of sh
. However, bash is not supported by all docker images. I guess that's why docker does not have a configuration option to use bash as a default.
If bash is installed for a specific container, you can symlink
sh
to bash
inside the container, so that bash
is used by default. Open a container console and type:
ln -sf /bin/bash /bin/sh
Close the console and open it again. Now you are using bash, supporting arrow key actions.
It's possible to include that in the docker image as well.
Also see: