kovidgoyal / kitty

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

gpg-connect-agent password prompt gets auto filled by kitten - unable to enter password #6977

Closed martin-fiedler closed 10 months ago

martin-fiedler commented 10 months ago

Describe the bug When using normal ssh I can enter my password for nitrokey decryption, but If I use kitten ssh (which is needed or else the 'xterm-kitty': unknown terminal type error comes up) the password prompt gets auto filled by kitten.

It is also not possible to delete what ever kitten tries to pass, as it gets filled out in an endless loop.

To Reproduce Plug in a gpg based usb token (in my case Nitrokey) Run gpg-connect-agent updatestartuptty /bye Have as ssh alias kitten ssh ssh username@hostname

Screenshots With Kitten after entering ssh user@hostname image

With SSH after entering ssh user@hostname image

Environment details

kitty 0.31.0 created by Kovid Goyal
Linux mfiedler-workwise 6.6.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Jan 2024 16:20:41 +0000 x86_64
EndeavourOS Linux 6.6.10-arch1-1 (/dev/tty)

DISTRIB_ID="EndeavourOS"
DISTRIB_RELEASE="rolling"
DISTRIB_DESCRIPTION="EndeavourOS Linux"
DISTRIB_CODENAME="rolling"
Running under: Wayland
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /usr/bin/zsh
Loaded config files:
  /home/mfiedler/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style   (True, False)
confirm_os_window_close 0
font_family             FiraCode Nerd Font
inactive_tab_font_style (True, False)
macos_titlebar_color    370548226
selection_foreground    None
tab_fade                (1.0,)
window_padding_width    FloatEdges(left=25.0, top=25.0, right=25.0, bottom=25.0)
Colors:
    active_border_color     #3d59a1   
    active_tab_background   #16161e   
    active_tab_foreground   #3d59a1   
    background              #24283b   
    bell_border_color       #e0af68   
    color0                  #414868   
    color1                  #f7768e   
    color10                 #73daca   
    color11                 #e0af68   
    color12                 #7aa2f7   
    color13                 #d33682   
    color14                 #7dcfff   
    color15                 #c0caf5   
    color2                  #73daca   
    color3                  #e0af68   
    color4                  #7aa2f7   
    color5                  #d33682   
    color6                  #7dcfff   
    color7                  #c0caf5   
    color8                  #414868   
    color9                  #f7768e   
    cursor                  #c0caf5   
    cursor_text_color       #1a1b26   
    foreground              #a9b1d6   
    inactive_border_color   #101014   
    inactive_tab_background #16161e   
    inactive_tab_foreground #787c99   
    selection_background    #28344a   
    tab_bar_background      #101014   
    url_color               #9ece6a   

Important environment variables seen by the kitty process:
    PATH                                /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
    LANG                                en_US.UTF-8
    EDITOR                              nano
    SHELL                               /usr/bin/zsh
    DISPLAY                             :1
    WAYLAND_DISPLAY                     wayland-1
    USER                                mfiedler
    XCURSOR_SIZE                        20
    XDG_SESSION_PATH                    /org/freedesktop/DisplayManager/Session1
    XDG_BACKEND                         wayland
    LC_ADDRESS                          de_DE.UTF-8
    LC_NAME                             de_DE.UTF-8
    LC_MONETARY                         de_DE.UTF-8
    XDG_SEAT                            seat0
    XDG_SESSION_DESKTOP                 Hyprland
    XDG_SESSION_TYPE                    wayland
    LC_PAPER                            de_DE.UTF-8
    XDG_CURRENT_DESKTOP                 Hyprland
    XDG_SEAT_PATH                       /org/freedesktop/DisplayManager/Seat0
    XDG_SESSION_CLASS                   user
    LC_IDENTIFICATION                   de_DE.UTF-8
    LC_TELEPHONE                        de_DE.UTF-8
    LC_MEASUREMENT                      de_DE.UTF-8
    XDG_VTNR                            1
    XDG_SESSION_ID                      2
    XDG_RUNTIME_DIR                     /run/user/1000
    LC_TIME                             de_DE.UTF-8
    LC_NUMERIC                          de_DE.UTF-8
kovidgoyal commented 10 months ago

The kitten is not autofilling anything, it is transmistting data over the tty. I have no idea what gpg-connect-agent does. Presumably it is something you have configured ssh to use for authentication? Use the https://sw.kovidgoyal.net/kitty/kittens/ssh/#opt-kitten-ssh.askpass askpass option. Set it to ssh and you should be fine, at the cost of increased initial connection latency.