Skip to content

The diff kitten clears the terminal or moves the cursor #3176

@spejamchr

Description

@spejamchr

Describe the bug
In zsh the terminal gets cleared after using the diff kitten.

In bash the cursor gets moved to the top, and subsequent output overwrites/intermingles with the existing output.

To Reproduce
Steps to reproduce the behavior with zsh:

  1. Open kitty with kitty -c=NONE zsh --no-rcs --no-globalrcs
  2. In kitty, run a command that results in output, such as echo $TERM (outputs xterm-kitty)
  3. Run the diff kitten with kitty +kitten diff --config=NONE .powrc .ruby-version (or some other pair of existing files)
  4. Close the diff kitten with q
  5. Bug: The terminal has been cleared, so that the line echo $TERM and its output is no longer visible.

Steps to reproduce the behavior with bash:

  1. Open kitty with kitty -c=NONE bash --noprofile --norc
  2. In kitty, run a command that result in output, such as echo $TERM (outputs xterm-kitty)
  3. Run the diff kitten with kitty +kitten diff --config=NONE .powrc .ruby-version (or some other pair of existing files)
  4. Close the diff kitten with q
  5. The cursor is now on the top line:
bash-3.2$ █ 
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ echo $TERM
xterm-kitty
bash-3.2$ kitty +kitten diff --config=NONE .powrc .ruby-version 

And subsequent output overwrites/intermingles with the existing output.

bash-3.2$ echo $TERM
xterm-kitty interactive shell is now zsh.
bash-3.2$ █our account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ echo $TERM
xterm-kitty
bash-3.2$ kitty +kitten diff --config=NONE .powrc .ruby-version 

Expected behavior

I would expect no output from the diff kitten once the kitten has been closed, and for the cursor to continue onto the next line:

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ echo $TERM
xterm-kitty
bash-3.2$ kitty +kitten diff --config=NONE .powrc .ruby-version
bash-3.2$ █

Screenshots

Environment details
macos 10.15.7 (Catalina)

bash-3.2$ kitty --debug-config
kitty 0.19.2 (09e75ea329) created by Kovid Goyal
Darwin EXO00240-schristiansen 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
ProductName:	Mac OS X ProductVersion:	10.15.7 BuildVersion:	19H15

Config options different from defaults:

(output of kitty --debug-config is the same in zsh)

Edit: This seems similar to #1901, but I'm not experiencing that issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions