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. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
As suggested within the configuration docs, I have the following in my
kitty.conffile: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^Lcharacter to appear on the screen. (This can, of course, be deleted usingBACKSPACEkey.) 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_textcommand conditionally? Perhaps it could be another cousin ofsend_textthat 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_closeoption, it appears that kitty may be able to detect whether the underlying shell is busy running another command or not.All reactions