Docker detach keys

If you like me and use CTRL-P/CTRL-N instead of arrow keys to navigate through command history, you should be disappointed on how CTRL-P works in docker terminal (the one you see after docker run, docker exec).

It turned out CTRL-P is used for what they call detaching from terminal, which I didn't know about even.

So basically when you press CTRL-P the terminal is waiting for another key press (CTRL-Q in current case). That's why CTRL-P works in strange way.

The issue was solved couple of years ago.

What you need to do is create .docker folder in your home directory (mkdir ~/.docker) and create config.json file there with this content:

{
    "detachKeys": "ctrl-@"
}
Proxy Information
Original URL
gemini://g.codelearn.me/2018-03-01-docker-terminal-navigation.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
445.37372 milliseconds
Gemini-to-HTML Time
0.258048 milliseconds

This content has been proxied by September (3851b).