问题
Docker container's detach key sequence by default is control+q or control+p.
There is an option to set key sequence when starting a container using --detach-keys "<sequence>" but I am looking for a permanent change.
Is there a way to change this key sequence to something else?
回答1:
Per user, you can configure this in the $HOME/.docker/config.json file. Add a json entry similar to:
{
"auths": { ... },
"detachKeys": "ctrl-x,x"
}
The "auths" line is just giving a relative location in the json, ignore this if you don't have an existing logins stored in this file. See this documentation for more details.
来源:https://stackoverflow.com/questions/39782538/how-do-you-change-default-detach-key-sequence-in-docker