{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/15666","labels_url":"https://api.github.com/repos/docker/docker/issues/15666/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/15666/comments","events_url":"https://api.github.com/repos/docker/docker/issues/15666/events","html_url":"https://github.com/docker/docker/pull/15666","id":101685919,"number":15666,"title":"Implement configurable escape key for attach/exec","user":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/3-docs-review","name":"status/3-docs-review","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/44","html_url":"https://github.com/docker/docker/milestones/1.10","labels_url":"https://api.github.com/repos/docker/docker/milestones/44/labels","id":1351533,"number":44,"title":"1.10","description":"","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":43,"state":"open","created_at":"2015-10-12T18:21:55Z","updated_at":"2015-12-21T03:32:22Z","due_on":null,"closed_at":null},"comments":64,"created_at":"2015-08-18T15:41:30Z","updated_at":"2015-12-21T14:27:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/15666","html_url":"https://github.com/docker/docker/pull/15666","diff_url":"https://github.com/docker/docker/pull/15666.diff","patch_url":"https://github.com/docker/docker/pull/15666.patch"},"body":"Implement configurable escape keys (for `attach`, `exec`, `run` and `start`) using the client-side configuration and/or flags `--detach-keys`. This takes some pieces from #6460 from @vieux — except that this time it uses the client configuration (`~/.docker/config.json` for example). 🐧\r\n\r\n> This PR allows you to change the set of keys you have to type to detach in TTY mode, it can be less or more that two.\r\n> The basic ASCII table is supported, for example you can do: docker -d --detach-keys=\"ctrl-@\" and detach in one keystroke or docker -d --detach-keys=\"DEL,+\" if you don't like to have a ctrl key\r\n\r\nThe configuration looks like this :\r\n\r\n```json\r\n{\r\n    \"detachKey\": \"ctrl-a,a\"\r\n}\r\n```\r\n\r\nThe default keybinding stays the same : `ctrl-p ctrl-q` but it makes possible to configure something else.\r\n\r\nThere is room for improvements on the code that should be address during the design review process I think :\r\n- For `attach` command I use *queryString* (`detachKeys=ctrl-a%2Ca`) but for `exec` command I used `runConfig.ExecConfig`. That felt weird and it's not coherent, it should be the same thing for both. It could maybe be passed as HTTP Header, I don't know :sweat_smile: — that's why I'm putting this in review.\r\n- Right now, I don't validate the configuration client side, so if there is something wrong with the `detachKeys` passed, It's just logged and the defaults one are used.\r\n- Some refactoring is there is a little too much duplicated code for my taste (the `keys, err = term.ToBytes(detachKeys)` part is repeated few times..).\r\n- Probably add a `json:omitempty` for `DetachKeys` on `runconfig.ExecConfig`.\r\n\r\nWhat is still to do :\r\n- [X] Rebase it :sweat_smile:\r\n- [X] Implement flags by commands (`run`, `start`, `attach`, `exec`)\r\n- [X] Write some integration tests.\r\n- [X] Update some documentation.\r\n- [X] Update the commit message to make it more clear :sweat_smile:.\r\n\r\n🐸\r\n\r\nFixes #3519.\r\n\r\nSigned-off-by: Vincent Demeester <vincent@sbr.pm>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/166316962","html_url":"https://github.com/docker/docker/pull/15666#issuecomment-166316962","issue_url":"https://api.github.com/repos/docker/docker/issues/15666","id":166316962,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T14:27:13Z","updated_at":"2015-12-21T14:27:13Z","body":"Looks like the online documentation for attach, exec and start also need to be updated. Also, can this option be set for *create* and *run*?"}}