kovidgoyal / kitty

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

SSH Kitten has stopped working #6608

Closed snoblenet closed 1 year ago

snoblenet commented 1 year ago

Describe the bug

About two weeks ago, I started a project that required me to use SSH all the time.

I found that various keycodes were not being recognised -- e.g. backspace -- and I solved the issue by adding this to my ~/.zshrc:

[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"

About two days ago, the following message started appearing at my prompt when using ssh:

builtin declare -F _ksi_prompt_command > /dev/null 2> /dev/null && _ksi_prompt_command

Also, other strange behaviour has begun. For example, if I type ls mi<tab> to autocomplete to ls migrations, I now see this instead:

$ ls miwords=("${@:3:2}")
cword="$3"
cur="$3"
cur="$3"
cword="$3"
prev="$3"
words=("${@:3:2}")
grations/

To Reproduce

  1. alias the SSH kitten
  2. connect to a remote instance using SSH
  3. enter any command and see the strange message
  4. try to use autocomplete and see the even stranger message

Environment details

kitty 0.29.1 (a0341af3f8) created by Kovid Goyal
Darwin Stevens-Laptop.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64
ProductName:        macOS ProductVersion:       13.5.1 BuildVersion:        22G90
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/steven/.config/kitty/kitty.conf
Loaded config overrides:
  macos_quit_when_last_window_closed yes

Config options different from defaults:
active_tab_title_template          β€Š{index}. {title} πŸ­¨β–ˆβ–ˆ
allow_remote_control               yes
bold_font                          Victor Mono Bold
bold_italic_font                   Victor Mono Bold Italic
confirm_os_window_close            0
copy_on_select                     clipboard
enabled_layouts                    ['stack']
font_family                        Victor Mono Medium
font_size                          20.0
inactive_tab_font_style            (True, True)
italic_font                        Victor Mono SemiBold Italic
listen_on                          /tmp/mykitty
macos_quit_when_last_window_closed True
modify_font:
    cell_height 10
scrollback_pager                   ['/usr/local/bin/nvim']
scrollback_pager_history_size      2097152000
strip_trailing_spaces              smart
tab_bar_edge                       1
tab_bar_min_tabs                   1
tab_bar_style                      separator
tab_separator                      
tab_switch_strategy                left
tab_title_template                  {index}. {title} πŸ­¨β–ˆβ–ˆ
Added shortcuts:
    cmd+` β†’  next_tab
    shift+cmd+` β†’  previous_tab
Changed shortcuts:
    cmd+1 β†’  goto_tab 1
    cmd+2 β†’  goto_tab 2
    cmd+3 β†’  goto_tab 3
    cmd+4 β†’  goto_tab 4
    cmd+5 β†’  goto_tab 5
    cmd+6 β†’  goto_tab 6
    cmd+7 β†’  goto_tab 7
    cmd+8 β†’  goto_tab 8
    cmd+9 β†’  goto_tab 9
    cmd+n β†’  new_tab_with_cwd
    cmd+t β†’  new_tab_with_cwd
Colors:
    active_tab_background              #81a1c1   
    active_tab_foreground              #2e3440   
    background                         #2e3440   
    color0                             #3b4252   
    color1                             #bf616a   
    color10                            #a3be8c   
    color11                            #ebcb8b   
    color12                            #81a1c1   
    color13                            #b48ead   
    color14                            #8fbcbb   
    color2                             #a3be8c   
    color3                             #ebcb8b   
    color4                             #81a1c1   
    color5                             #b48ead   
    color6                             #88c0d0   
    color7                             #e5e9f0   
    color8                             #4c566a   
    color9                             #bf616a   
    cursor                             #81a1c1   
    foreground                         #d8dee9   
    inactive_tab_background            #d8dee9   
    inactive_tab_foreground            #2e3440   
    tab_bar_background                 #2e3440   

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                en_AU.UTF-8
    SHELL                               /bin/zsh
    USER                                steven

Additional context

The AWS EC2 instance that I am connecting to is running Ubuntu and is based on ami-04e601abe3e1a910f.

kovidgoyal commented 1 year ago

Does not reproduce for me with those steps. Most likely you changed something in your shell rc files which is conflicting with kitty's shell integration, causing the issues. Bisect them.

snoblenet commented 1 year ago

Turns out a script on the instance was enabling verbose on the parent shell.

Disabling verbose was enough to revert the behaviour.

set +o verbose