-
Notifications
You must be signed in to change notification settings - Fork 974
Description
kubectl run -it
and kubectl attach -it
connect to a Docker container in a manner parallel to docker run -it
and docker attach
. All these commands by default listen for the key sequence ctrl-p,ctrl-q
to cause the command to detach from the container. However, only the docker
commands have a --detach-keys
option to allow you to specify an alternate key sequence to use instead of the default. kubectl
is missing this option. Please implement it.
The default is problematic with bash
because by default, ctrl-p
on the bash
command line brings up the previous command from the history list. Users typing ctrl-p
once expect to see the previous command, but get nothing until they type another character, as the ctrl-p
is held back until the next character is sent. If the next character is ctrl-q
the connection is closed and the container never sees the ctrl-p
. If the next character is something else, then the ctrl-p
and the next character are sent as soon as the second character is typed. If that character is ctrl-p
, then the user will get the to see the command before the previous command, as they have just typed ctrl-p,ctrl-p
. So getting to the immediately previous command requires typing ctrl-p
followed by some other character that will not alter the command line. This is annoying at best.
Whatever issues people may have with the default detach key sequence in docker
are alleviated by the presence of the --detach-keys
option and the detachKeys
property of the docker
configuration. However kubectl
does not have this option.
Please add a --detach-keys
option that operates the same way as docker --detach-keys
does.