Mapping a keyboard shortcut to clear terminal and redraw current line #3654
salmankhilji
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
It's not possible in general. Think of running a shell over ssh. Without co-operation from the shell there is no robust way to do this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As suggested within the configuration docs, I have the following in my
kitty.conf
file:When there is no command running within bash (i.e., when it is showing the prompt), this works great: I can clear the terminal and force bash to redraw the prompt using a single keyboard shortcut.
The issue is that when I have active long running command within bash, say
adb logcat
, then this keyboard shortcut produces an unwanted^L
character to appear on the screen. (This can, of course, be deleted usingBACKSPACE
key.) The current workaround is again to map two keyboard shortcuts: one to press when bash is not running a program and another to press when bash is running a long running program. This is not ideal.Is there anyway we can get kitty to execute the
send_text
command conditionally? Perhaps it could be another cousin ofsend_text
that internally would only execute if the underlying shell is not running a command, like this:However, I am not sure if it is even possible for kitty to detect whether a command is currently running within the shell or not. Looking at the
confirm_os_window_close
option, it appears that kitty may be able to detect whether the underlying shell is busy running another command or not.Beta Was this translation helpful? Give feedback.
All reactions