Skip to content

Allow ctrl-p ctrl-q customization#6460

Closed
vieux wants to merge 3 commits intomoby:masterfrom
vieux:configurable_detach_keys
Closed

Allow ctrl-p ctrl-q customization#6460
vieux wants to merge 3 commits intomoby:masterfrom
vieux:configurable_detach_keys

Conversation

@vieux
Copy link
Copy Markdown
Contributor

@vieux vieux commented Jun 16, 2014

Closes #3519

@jamtur01 @SvenDowideit: documentation is coming, I want to make sure everyone agrees on the feature first.

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.

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 😄

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 16, 2014

ping @crosbymichael @unclejack @tiborvass

@SvenDowideit
Copy link
Copy Markdown
Contributor

nice

@SvenDowideit
Copy link
Copy Markdown
Contributor

can we please print out the detach key combo when a user gets attached to a container (run, start, attach, whatever)? otherwise we're not only relying on a memory game, but users won't know what was set - or worse, when it changes.

perhaps its something that docker info can print, if you don't want to tell them all the time

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 17, 2014

I like the docker info idea, @crosbymichael ?

@cpuguy83
Copy link
Copy Markdown
Member

This ought to be fun in a multi-user scenario

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 17, 2014

@cpuguy83 :) it's server side, so there is nothing we can do

vieux added 2 commits June 18, 2014 01:09
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 18, 2014

@SvenDowideit updated

Comment thread api/client/commands.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ctrl=p/ctrl-p/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also s/Fprintf/Fprint/ since there are no variables to be interpolated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, maybe we don't need the else part since it is redundant with the default value of the flDetachKeys flag in docker.go. By default, detachKeys will be non-empty and thus we would never enter the else codepath.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that for compatibility with old version, but maybe you're right, we could remove it since we don't support new client with old server.

Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 18, 2014

@tiborvass updated

@crosbymichael
Copy link
Copy Markdown
Contributor

So you set this key combo on the daemon and it's translated server side?

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 18, 2014

yes, to an array of byte

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 18, 2014

@crosbymichael

@crosbymichael
Copy link
Copy Markdown
Contributor

isn't this more of a client side option? if you have a few users connected to a docker daemon they would want to specify their own key combos???

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 18, 2014

@crosbymichael we could, but it's a much bigger change regarding the api.
Also we don't have config for the client, it would force you to specify the --detach-keys on each docker run

Do you have an idea ?

@crosbymichael
Copy link
Copy Markdown
Contributor

ya, im not sure what to do for this one right now

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 20, 2014

@shykes do you think it's useful to add this in the daemon or should we wait for a way to do it per client ?

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented Jun 23, 2014

I think adding this to the client makes sense. There could be a client configuration file that prevents having to specify the flag every time.

@vieux vieux closed this Jun 27, 2014
@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented Jun 27, 2014

I'll wait to have a config file client side for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configurable Ctrl-p+Ctrl+q

6 participants