Ctrl + Enter does not execute the query on many terminals #598
-
Hey @tconbeer, very cool and useful project. Running this is a MacOS default terminal, all commands work except Run Query. I tried all combinations (cmd + enter, ctrl + enter), but it results in a new line. Any thoughts on what could be the issue? |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 1 reply
-
NOTE to those with this issue:
I'll be improving this experience soon. --- Original message --- I don't have access to a Mac -- if you could do me a favor, could you install the textual dev tools and run the keys app? $ pip install textual[dev]
$ textual keys Then while running that app, can you press |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into it! Strangely enough, both Let me know if I can help with any additional info. |
Beta Was this translation helpful? Give feedback.
-
Amazing. I'll update the docs for ctrl+j. (Different terminals support different key combinations) |
Beta Was this translation helpful? Give feedback.
-
I'm seeing this same issue in Ubuntu. Control+Enter does not work, but Control+j does. I've tried this with both the default Ubuntu terminal as well as my primary terminal, Guake. Edit: this appears this is a limitation of the underlying terminal emulators. when I run from googling around, control+enter just seems to be something that doesn't really work across terminal emulators. the only workarounds I've seen involve remapping the codes sent by keyboard keys for the terminal emulator you're using. which I'm not really keen to dive into |
Beta Was this translation helpful? Give feedback.
-
Other than making ctrl+j better documented, is there a key combination either of you would think is more intuitive for submit? (I could also add a more obvious button, although the footer doubles as a row of buttons) |
Beta Was this translation helpful? Give feedback.
-
I reckon adding a submit button would be good regardless of whether another key combination is added. Would make it generally more accessible and folks would at least have that option if they've missed the documentation. As for other combinations, how about control+space? that looks to have a different key code than space on its own in my terminal emulator. |
Beta Was this translation helpful? Give feedback.
-
+1 for a button, since the UI already supports mouse clicks. |
Beta Was this translation helpful? Give feedback.
-
Same issue here, ctrl-j works however |
Beta Was this translation helpful? Give feedback.
-
I'm using kitty terminal and having this issue. Did y'all figure out why ctrl+enter doesn't work? It would be nice to be able to use ctrl+enter to execute queries. I've tried keymapping option+enter as well, unsuccessfully. |
Beta Was this translation helpful? Give feedback.
ctrl+enter
is intercepted by your terminal and forwarded to your shell as a different virtual key, probably the plainenter
. You need to change your terminal config to make it forwardctrl+enter
as eitherctrl+enter
orctrl+j
(as windows terminal and others do), so that Harlequin (via your shell) receives the correct keypress. A little more info here: https://harlequin.sh/docs/troubleshooting/key-bindings