docker change Ctrl+p to something else?

Viewed 12745

I am using docker run /bin/bash to develop my container and every time I want to use Ctrl+p in a terminal or in emacs, I have to type it twice, since docker uses it to detach from a container (Ctrl+p Ctrl+q).

How can I change Ctrl+p to something else more convenient that is not used in emacs or in a terminal setting?

5 Answers

If anyone still can't get Ctrl-P to work inside a container even after changing the detach keys and calling Ctrl-P just prints out ^P in the terminal instead of going up an entry in your history, make sure the shell you're using in the container can actually handle the process signals.

E.g. instead of docker run -it ... sh.

Use docker run -it ... bash.

To use this without changing global configuration

docker exec --detach-keys='ctrl-e,e' -ti foo /bin/bash
Related