💾 Archived View for g.codelearn.me › 2018-03-01-docker-terminal-navigation.gmi captured on 2024-08-18 at 17:24:50. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

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-@"
}