kovidgoyal / kitty

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

Pasting stopped working since today #7376

Closed zjeffer closed 3 weeks ago

zjeffer commented 3 weeks ago

Describe the bug

I get the following error when pasting something into kitty:

Key action failed

paste_from_clipboard
cannot access local variable 'replaced_newlines' where it is not associated with a value

Press e to see detailed traceback or any other key to exit
Traceback (most recent call last):
  File "/usr/bin/../lib/kitty/kitty/boss.py", line 1588, in combine
    if self.dispatch_action(actions[0], window_for_dispatch, dispatch_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/../lib/kitty/kitty/boss.py", line 1542, in dispatch_action
    passthrough = f(*key_action.args)
                  ^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/../lib/kitty/kitty/boss.py", line 2136, in paste_from_clipboard
    self.paste_to_active_window(text)
  File "/usr/bin/../lib/kitty/kitty/boss.py", line 2131, in paste_to_active_window
    w.paste_with_actions(text)
  File "/usr/bin/../lib/kitty/kitty/window.py", line 1628, in paste_with_actions
    if replaced_c0_control_codes or replaced_newlines:
                                    ^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'replaced_newlines' where it is not associated with a value

Press Enter or Esc to exit

I think it's caused by this commit: https://github.com/kovidgoyal/kitty/commit/ef9d279305ac30111cfa76ae9d54429a9e4de7c8

EDIT: can confirm it's that commit

To Reproduce Steps to reproduce the behavior:

  1. Copy anything (even a single letter triggers the issue) to the system clipboard
  2. Use ctrl+shift+v to paste into kitty
  3. error

Screenshots

image

Environment details

Colors:
        background                 #2e3440   
        color0                     #3b4252   
        color1                     #bf616a   
        color10                    #a3be8c   
        color11                    #ebcb8b   
        color12                    #81a1c1   
        color13                    #b48ead   
        color14                    #8fbcbb   
        color15                    #eceff4   
        color2                     #a3be8c   
        color3                     #ebcb8b   
        color4                     #81a1c1   
        color5                     #b48ead   
        color6                     #88c0d0   
        color7                     #e5e9f0   
        color8                     #4c566a   
        color9                     #bf616a   
        cursor                     #e5e9f0   
        foreground                 #d8dee9   

Important environment variables seen by the kitty process:
        PATH                                /usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/usr>
        LANG                                en_US.UTF-8
        SHELL                               /usr/bin/zsh
        DISPLAY                             :1
        WAYLAND_DISPLAY                     wayland-1
        USER                                zjeffer
        XCURSOR_SIZE                        28
        XDG_CONFIG_DIRS                     /etc/xdg
        XDG_SESSION_PATH                    /org/freedesktop/DisplayManager/Session1
        XDG_BACKEND                         wayland
        XDG_DATA_HOME                       /home/zjeffer/.local/share
        XDG_CONFIG_HOME                     /home/zjeffer/.config
        XDG_SEAT                            seat0
        XDG_SESSION_DESKTOP                 
        XDG_SESSION_TYPE                    wayland
        XDG_CURRENT_DESKTOP                 Hyprland
        XDG_SEAT_PATH                       /org/freedesktop/DisplayManager/Seat0
        XDG_CACHE_HOME                      /home/zjeffer/.cache
        XDG_SESSION_CLASS                   user
        XDG_VTNR                            1
        XDG_SESSION_ID                      2
        XDG_RUNTIME_DIR                     /run/user/1000
        XDG_DATA_DIRS                       /usr/local/share:/usr/share
zjeffer commented 3 weeks ago

Thanks for the quick fix!