-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Being in a toolbox breaks Ctrl-p for readline #394
Comments
Sorry, a detail I forgot to mention: pressing C-p repeatedly, only every other press works. If I have the following command history:
The following sequences happen: C-p C-p shows C-p C-p C-p shows |
I've been researching this myself and I know how to fix it. Podman has a feature called detaching that listens for a key sequence and then detaches the tty from the running container. By default, that key sequence is "ctrl-p, ctrl-q". The problem has been that there was no way to turn this feature off (the best you could do was assign a different key sequence, but not turn if off entirely.) This is a bug fixed in podman 1.8.2 : containers/podman#5203 - you can now set the key sequence to the empty string (--detach-keys="") and this will completely disable the detach feature. Toolbox needs a change to specify the detach-keys for podman. Here is my fork that is tested working, but it could likely be made more robust/configurable. EnigmaCurry@2baf60f I will look into what it takes to open a PR for this... |
Podman sets keys 'ctrl-p' and 'ctrl-q' as the default detach keys. This behaviour is not desirable in Toolbox. Since Podman v1.8.2[0] it is possible to have set no detach keys by passing an empty string to the --detach-keys option. Thanks to this the 'Ctrl+p' and 'Ctrl-q' combinations are doing what they should do normally in a terminal. [0] containers/podman#5203 Fixes: containers#394 containers#396
Podman sets keys 'ctrl-p' and 'ctrl-q' as the default detach keys. This behaviour is not desirable in Toolbox. Since Podman v1.8.2[0] it is possible to have set no detach keys by passing an empty string to the --detach-keys option. Thanks to this the 'Ctrl+p' and 'Ctrl-q' combinations are doing what they should do normally in a terminal. [0] containers/podman#5203 Fixes: containers#394 containers#396
Podman sets keys 'ctrl-p' and 'ctrl-q' as the default detach keys. This behaviour is not desirable in Toolbox. Since Podman v1.8.2[0] it is possible to have set no detach keys by passing an empty string to the --detach-keys option. Thanks to this the 'Ctrl+p' and 'Ctrl-q' combinations are doing what they should do normally in a terminal. [0] containers/podman#5203 Fixes: containers#394 containers#396
Podman sets 'ctrl-p ctrl-q' as the default key sequence for detaching a container. This breaks the ctrl-p shortcut that's equivalent to the up arrow key in GNU Readline environments like Bash and Emacs. Moreoever, toolbox containers aren't meant to be detached in the first place. Since Podman 1.8.1, it is now possible to unset the key sequence for detaching [2, 3]. [0] https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC15 [1] https://www.gnu.org/software/emacs/tour/ [2] Podman commit 7c623bd41ff3d534 containers/podman#4208 [3] Podman commit ebfd253fc658ffc9 containers/podman#5166 containers#394
Podman sets 'ctrl-p ctrl-q' as the default key sequence for detaching a container. This breaks the ctrl-p shortcut that's equivalent to the up arrow key in GNU Readline environments like Bash and Emacs. Moreoever, toolbox containers aren't meant to be detached in the first place. Since Podman 1.8.1, it is now possible to unset the key sequence for detaching [2, 3]. [0] https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC15 [1] https://www.gnu.org/software/emacs/tour/ [2] Podman commit 7c623bd41ff3d534 containers/podman#4208 [3] Podman commit ebfd253fc658ffc9 containers/podman#5166 containers#394
I use the readline commands for navigating my command history in bash. That is: C-p for previous, C-n for next. C-p should do the same thing as up-arrow, and C-n should do the same as down-arrow.
When I am in a toolbox and I press C-p to get my previous command, nothing shows up. If I press return, the command shows up, and executes, but it was not visible until I press return. If I press C-p twice, I see the two-commands-ago command line, and then pressing C-n gives me the previous command.
This only happens when I am inside a toolbox on Fedora Silverblue. I have not tried it on other platforms. It does not happen on the same machine, when I am not in a toolbox.
up-arrow and down-arrow work just fine.
The text was updated successfully, but these errors were encountered: