Kitty: Allow clearing pane like iterm CMD-k

Created on 26 Jul 2018  路  4Comments  路  Source: kovidgoyal/kitty

One of my favourite features in iterm2 is the ability to completely clear the screen (and the scrollback buffer as well) with a single keystroke. No matter what's on the screen, it all gets cleared. Do you think something similar is achievable with kitty? The main thing is, doing it without having to put the current process in background to enter a shell command or send some key sequence.

Most helpful comment

I'd like to add a small addendum to this: The new scrollback clearing code does wipe scrollback, but then only clears the screen and moves your cursor to the upper-left corner, without redrawing the prompt. This can be combined with sending a hex 0c (ctrl-L, which will tell the os to redraw the prompt) to the terminal with this config entry:

map cmd+k combine : clear_terminal scrollback active : send_text normal \x0c

...which makes cmd-k act as you'd expect if you're switching over from iTerm.

All 4 comments

You're the man! Thanks a lot, this is exactly what I needed! Great job! :) :) :+1:

I'd like to add a small addendum to this: The new scrollback clearing code does wipe scrollback, but then only clears the screen and moves your cursor to the upper-left corner, without redrawing the prompt. This can be combined with sending a hex 0c (ctrl-L, which will tell the os to redraw the prompt) to the terminal with this config entry:

map cmd+k combine : clear_terminal scrollback active : send_text normal \x0c

...which makes cmd-k act as you'd expect if you're switching over from iTerm.

map cmd +k combine : clear_terminal scrollback active : send_text normal,application \x0c is what worked for me

map cmd+k send_text terminal,application \x63\x6C\x65\x61\x72\x0A seems to be working for an ohmyzsh + kitty configuration on macOS.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skosch picture skosch  路  3Comments

Nudin picture Nudin  路  3Comments

Jomik picture Jomik  路  4Comments

crocket picture crocket  路  4Comments

hujianxin picture hujianxin  路  3Comments