kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.15k stars 972 forks source link

Cmd+K does not clear images on MacOS #7164

Closed spinicist closed 7 months ago

spinicist commented 7 months ago

Describe the bug

Use kitten icat to draw graphics in the terminal. Generate some text with whatever program you like. Hit Cmd+K. The text is cleared, the cursor returns to the top of the screen, but the graphics remain in place.

I expected graphics to be cleared as well - should I not have expected this? Is there a different shortcut to clear graphics? I couldn't see anything in the icat documentation.

(PS Thanks for making KiTTY, it's great and a route to really improving my workflow in various ways)

Screenshots

Here is a screenshot after hitting Cmd+K.

Screenshot 2024-02-27 at 11 16 46

Environment details

kitty 0.30.0 (ef8e3b150c) created by Kovid Goyal
Darwin Prefect.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
ProductName:        macOS ProductVersion:       14.2.1 BuildVersion:        23C71
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/tobias/.config/kitty/kitty.conf

Config options different from defaults:
font_family      Source Code Pro
font_size        16.0
scrollback_lines 20000
symbol_map:
    U+e000 - U+e00d → Symbols Nerd Font
    U+e300 - U+e3eb → Symbols Nerd Font

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                en_GB.UTF-8
    SHELL                               /bin/zsh
    DISPLAY                             /private/tmp/com.apple.launchd.SQPyskBlcb/org.xquartz:0
    USER                                tobias
spinicist commented 7 months ago

It's actually a little worse than I thought - the graphics remain but with a higher z-order than text:

Screenshot 2024-02-27 at 11 42 23

If I repeatedly spam text and hit Cmd+K the graphics do gradually move towards the screen and eventually off it.

kovidgoyal commented 7 months ago

Just do a regular clear command not sure why you are using cmd-K. IIRC cmd-K is mapped to clear to line with cursor only.

spinicist commented 7 months ago

Cmd+K is clear screen in Terminal.app, I tried it through muscle memory.

By "regular clear" do you mean "Reset Terminal" as listed here: https://sw.kovidgoyal.net/kitty/overview/#other-keyboard-shortcuts? Or did I miss something else? That shortcut full clears the screen without giving a prompt like Cmd+K.

kovidgoyal commented 7 months ago

Type clear at the prompt and press enter

spinicist commented 7 months ago

Not going to lie, I completely forgot that existed. Thanks.