-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
No way to input single "ctrl-p" keypress #4208
Comments
@haircommander @giuseppe @mheon Is this conmon/podman waiting for a sequence to disconnect from the container?
We might need to either disable this feature or setup alternative key mappings. |
@debarshiray WDYT? |
This is the CopyDetachable code in Podman |
Is there an easy way for toolbox to disable this? |
Reading the code right now: it seems like it pauses the copy until it can check the buffer fully for C-p C-q if a C-p is detected. Once it can check, if it is not that key sequence, it's copied in its entirely - so sending C-p C-a for example would result in both keys being send. The difficulty with special-casing C-p C-p is that we don't guarantee that the detach sequence is two keys only. We support, say, C-p C-q C-r as a detach sequence - for that case, would we expect that C-p C-p C-p sends a single C-p? |
Actually, the loop would probably terminate early, in the case of 3 keys - so C-p C-p would still work. |
The think is, how would I run podman and tell it I don't intend to detach. Another would be to put a strange squence. Could toolbox specifiy alt-; or something like that, so it would not be a common sequence used for bash recall. |
I think that setting detach keys to |
Sure, But can toolbox just execute
I don't think toolbox expects people to detach from toolboxes. But I will let @debarshiray comment. |
Wow, I use Yes, I agree. We don't expect people to want to detach a container while running an interactive shell. |
For now, simplest solution would be for Toolbox to override detach keys, then. I don't know if exec allows this yet; we can add it if it doesn't. |
exec does allow this! |
It doesn't look like
I also tried |
Grepping around in the code, I found:
So, it doesn't look like |
Yes lets open a PR to change the DefaultDetatchKeys to be set at a higher level and then to return empty list with "" |
Hey all, any progress on this? @rhatdan do you have a link to the PR you mentioned? |
This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days. |
@stove-panini Looks like this is fixed in upstream, although we have another issue. |
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
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
BUG
Description
While inside a terminal inside a container (such as toolbox), pressing "ctrl-p" does nothing while pressing it again sends two "ctrl-p" events to the terminal. This behavior interferes with the standard keybindings of common programs like emacs (where ctrl-p normally scrolls up one line) or bash (where ctrl-p steps back in the command history). Here is a simple demonstration of the problem.
podman run --rm -ti fedora-toolbox:30 bash
echo 1
echo 2
echo 3
Observe that "ctrl-p" does nothing while pressing it again returns
echo 2
instead ofecho 3
.Alternatively, check that using "ctrl-p" only allows one to scroll up two lines at a time in emacs.
One workaround would be to change the "detach-keys" sequence from "ctrl-p,ctrl-q" to something that hopefully does not conflict with any other program. But it would be better to just send one "ctrl-p" event for every two invocations of "ctrl-p".
Additional info:
The text was updated successfully, but these errors were encountered: