Allow copy/paste keybindings to pass through if they did nothing #2811
|
I really like to use the natural ctrl+c and ctrl+v to copy in a terminal. For ctrl+c : For ctrl+v |
Replies: 12 comments 20 replies
|
This would be pretty easy to support for Ghostty, we already have the I'd just like to repeat so I understand what you're asking: you want copy/paste but if they do nothing (i.e. the clipboard is empty) then you want them to encode the key and pass it on to the pty? |
|
Yes, you are right, you've understood exactly what I want. |
|
I've converted this to a discussion because actually I think we need to think about this a bit more. I'm very supportive of making this work, but I realized there's a central issue in the way keybindings work in Ghostty: We already know if an action was performed. We use this to pass through some keys already. But the keybindings are either always passthrough or always not on performed. What this issue is asking for is a conditional way to do that. The easy thing to do would be to make a new keybinding action like I want to consider introducing a new keybinding syntax so that we can generalize this to the behavior of "consume only if performed." This is missing today and it'd be possible for us to generalize. |
Kitty has a For pasting, I'm not sure how useful this would be, because unless the clipboard is explicitly cleared, in my experience there is always something already in the clipboard from a previous copy action.
In Vim, you can use Another idea is to swap |
+1 The main way I use this is with a smart copy feature, I use this with wezterm to handle copy when there is some selection: In termite, this is implemented like that: In kitty: |
|
I like the way kitty handle it with |
|
Made a mockup PR for an action similar to |
|
Yes, this is a must for me as well. An easy way to set ctrl+c ctrl+v. Or else I prolly wont be using Ghostty in the future, due its a deal breaking thing for me. Why I tend to use the Konsole instead. Seems like there is a fix to? Or am I misstaken? Im not sure how you do this? If someone can make me a small guide to do it. I would be verry happy. |
|
I'm trying out the new I've added this to my config: While ctrl+C correctly only copies when text is highlighted, SIGINT never seems to get sent. I'm testing with This is on fedora 40 with gnome and wayland. version: Is this working for anyone else? |
|
Coming from kitty, I had |
|
I think it would be useful to also clear selection on copy. Otherwise, the selection consumes ctrl+c forever, while being useless. 👍 |
|
Hit this specific case: stacking On GTK/Linux (Ghostty 1.3.2-dev tip, GNOME/Wayland), when no URL is hovered the action correctly reports as not-performable, but the fallthrough to the compiled-in default Matches what is noted above about needing OR/AND keybind logic (#3175) to reliably stack performable actions on one key. Working around it for now by dropping Edit: followed up on this further. The Also worth correcting: declaring a single Ended up giving up on one-key dual use and just splitting it across two keys instead, which works reliably: |
Approved #4328