kovidgoyal / kitty

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

kitty writes strange characters when pressing keyboard shortcuts #3575

Closed flexusjan closed 3 years ago

flexusjan commented 3 years ago

Describe the bug Pressing some shortcuts writes strange characters in the Kitty Terminal.

For example: shift+f1 prints "P" shift+f2 prints "Q" ctrl+f5 prints ";2~" shift+left prints "D" ... and many more

Pressing the same shortcuts in other Terminal-Emulators or Text-Editors doesn't print any characters.

To Reproduce Steps to reproduce the behavior:

  1. start kitty
  2. press shift+f1

Expected behavior Most of the shortcuts shouldn't print anything

Environment details

kitty 0.20.2 created by Kovid Goyal
Linux arch 5.10.34-1-lts #1 SMP Sun, 02 May 2021 12:41:09 +0000 x86_64
Arch Linux \r (\l)
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"
Loaded config files: /home/flexus/.config/kitty/kitty.conf
Running under: X11

Config options different from defaults:
background           Color(red=14, green=12, blue=21)
bell_on_tab          False
color0               Color(red=8, green=0, blue=46)
color1               Color(red=100, green=0, blue=44)
color10              Color(red=179, green=206, blue=88)
color11              Color(red=250, green=195, blue=87)
color12              Color(red=64, green=164, blue=207)
color13              Color(red=240, green=42, blue=174)
color14              Color(red=98, green=202, blue=168)
color15              Color(red=255, green=245, blue=219)
color2               Color(red=93, green=115, blue=26)
color3               Color(red=205, green=117, blue=28)
color4               Color(red=29, green=109, blue=161)
color5               Color(red=183, green=7, blue=126)
color6               Color(red=66, green=163, blue=140)
color7               Color(red=243, green=224, blue=184)
color8               Color(red=51, green=29, blue=76)
color9               Color(red=207, green=32, blue=98)
copy_on_select       clipboard
cursor               Color(red=187, green=187, blue=187)
enable_audio_bell    False
font_family          mononoki
font_size            13.0
foreground           Color(red=219, green=208, blue=185)
selection_background Color(red=243, green=224, blue=184)
selection_foreground Color(red=14, green=12, blue=21)
tab_bar_edge         1
window_alert_on_bell False
Removed shortcuts:
    shift+insert KeyAction(func='paste_from_selection', args=())
    shift+ctrl++ KeyAction(func='change_font_size', args=(True, '+', 2.0))
    shift+ctrl+, KeyAction(func='move_tab_backward', args=())
    shift+ctrl+- KeyAction(func='change_font_size', args=(True, '-', 2.0))
    shift+ctrl+. KeyAction(func='move_tab_forward', args=())
    shift+ctrl+0 KeyAction(func='tenth_window', args=())
    shift+ctrl+1 KeyAction(func='first_window', args=())
    shift+ctrl+2 KeyAction(func='second_window', args=())
    shift+ctrl+3 KeyAction(func='third_window', args=())
    shift+ctrl+4 KeyAction(func='fourth_window', args=())
    shift+ctrl+5 KeyAction(func='fifth_window', args=())
    shift+ctrl+6 KeyAction(func='sixth_window', args=())
    shift+ctrl+7 KeyAction(func='seventh_window', args=())
    shift+ctrl+8 KeyAction(func='eighth_window', args=())
    shift+ctrl+9 KeyAction(func='ninth_window', args=())
    shift+ctrl+= KeyAction(func='change_font_size', args=(True, '+', 2.0))
    shift+ctrl+[ KeyAction(func='previous_window', args=())
    shift+ctrl+] KeyAction(func='next_window', args=())
    shift+ctrl+` KeyAction(func='move_window_to_top', args=())
    shift+ctrl+a > 1 KeyAction(func='set_background_opacity', args=['1'])
    shift+ctrl+a > d KeyAction(func='set_background_opacity', args=['default'])
    shift+ctrl+a > l KeyAction(func='set_background_opacity', args=['-0.1'])
    shift+ctrl+a > m KeyAction(func='set_background_opacity', args=['+0.1'])
    shift+ctrl+b KeyAction(func='move_window_backward', args=())
    shift+ctrl+c KeyAction(func='copy_to_clipboard', args=())
    shift+ctrl+e KeyAction(func='kitten', args=['hints'])
    shift+ctrl+f KeyAction(func='move_window_forward', args=())
    shift+ctrl+h KeyAction(func='show_scrollback', args=())
    shift+ctrl+j KeyAction(func='scroll_line_down', args=())
    shift+ctrl+k KeyAction(func='scroll_line_up', args=())
    shift+ctrl+l KeyAction(func='next_layout', args=())
    shift+ctrl+n KeyAction(func='new_os_window', args=())
    shift+ctrl+o KeyAction(func='pass_selection_to_program', args=())
    shift+ctrl+p > f KeyAction(func='kitten', args=['hints', '--type path --program -'])
    shift+ctrl+p > h KeyAction(func='kitten', args=['hints', '--type hash --program -'])
    shift+ctrl+p > l KeyAction(func='kitten', args=['hints', '--type line --program -'])
    shift+ctrl+p > n KeyAction(func='kitten', args=['hints', '--type linenum'])
    shift+ctrl+p > w KeyAction(func='kitten', args=['hints', '--type word --program -'])
    shift+ctrl+p > y KeyAction(func='kitten', args=['hints', '--type hyperlink'])
    shift+ctrl+p > shift+f KeyAction(func='kitten', args=['hints', '--type path'])
    shift+ctrl+q KeyAction(func='close_tab', args=())
    shift+ctrl+r KeyAction(func='start_resizing_window', args=())
    shift+ctrl+s KeyAction(func='paste_from_selection', args=())
    shift+ctrl+t KeyAction(func='new_tab', args=())
    shift+ctrl+u KeyAction(func='kitten', args=['unicode_input'])
    shift+ctrl+v KeyAction(func='paste_from_clipboard', args=())
    shift+ctrl+w KeyAction(func='close_window', args=())
    shift+ctrl+escape KeyAction(func='kitty_shell', args=['window'])
    shift+ctrl+enter KeyAction(func='new_window', args=())
    shift+ctrl+backspace KeyAction(func='change_font_size', args=(True, None, 0.0))
    shift+ctrl+delete KeyAction(func='clear_terminal', args=['reset', True])
    shift+ctrl+left KeyAction(func='previous_tab', args=())
    shift+ctrl+right KeyAction(func='next_tab', args=())
    shift+ctrl+up KeyAction(func='scroll_line_up', args=())
    shift+ctrl+down KeyAction(func='scroll_line_down', args=())
    shift+ctrl+page_up KeyAction(func='scroll_page_up', args=())
    shift+ctrl+page_down KeyAction(func='scroll_page_down', args=())
    shift+ctrl+home KeyAction(func='scroll_home', args=())
    shift+ctrl+end KeyAction(func='scroll_end', args=())
    shift+ctrl+f2 KeyAction(func='edit_config_file', args=())
    shift+ctrl+f10 KeyAction(func='toggle_maximized', args=())
    shift+ctrl+f11 KeyAction(func='toggle_fullscreen', args=())
    shift+ctrl+kp_subtract KeyAction(func='change_font_size', args=(True, '-', 2.0))
    shift+ctrl+kp_add KeyAction(func='change_font_size', args=(True, '+', 2.0))
    shift+alt+ctrl+t KeyAction(func='set_tab_title', args=())

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

Same behavior with kitty --config NONE.

Output of kitty --debug-keyboard while pressing shift+f1

Loading new XKB keymaps
Modifier indices alt: 0x3 super: 0x6 hyper: 0xffffffff meta: 0xffffffff numlock: 0x4 shift: 0x0 capslock: 0x1
Press xkb_keycode: 0x32 clean_sym: Shift_L composed_sym: Shift_L mods: numlock glfw_key: 57441 (LEFT_SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 0xe061 native_code: 0xffe1 action: PRESS mods: numlock text: '' state: 0 ignoring as keyboard mode does not support encoding this event
Press xkb_keycode: 0x43 clean_sym: F1 composed_sym: F1 mods: shift+numlock glfw_key: 57364 (F1) xkb_key: 65470 (F1)
on_key_input: glfw key: 0xe014 native_code: 0xffbe action: PRESS mods: shift+numlock text: '' state: 0 sent key to child
Release xkb_keycode: 0x43 clean_sym: F1 mods: shift+numlock glfw_key: 57364 (F1) xkb_key: 65470 (F1)
on_key_input: glfw key: 0xe014 native_code: 0xffbe action: RELEASE mods: shift+numlock text: '' state: 0 ignoring as keyboard mode does not support encoding this event
Release xkb_keycode: 0x32 clean_sym: Shift_L mods: shift+numlock glfw_key: 57441 (LEFT_SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 0xe061 native_code: 0xffe1 action: RELEASE mods: shift+numlock text: '' state: 0 ignoring as keyboard mode does not support encoding this event
kovidgoyal commented 3 years ago

Its a feature see #3248

Cypher1 commented 1 year ago

Is there a way to turn this 'feature' off? Personally, I don't want P and similar characters when I try to open my Whisker (Start) Menu.

page-down commented 1 year ago

@Cypher1

If you often press other software shortcuts (or similar shortcuts) in kitty by mistake, you can configure the key action as discard_event and kitty will completely ignore the key and will not send the corresponding escape sequence to the program in the window.

map shift+f1 discard_event

https://sw.kovidgoyal.net/kitty/conf/#keyboard-shortcuts

kovidgoyal commented 1 year ago

@p1r473 wrong kitty project you want: https://github.com/cyd01/KiTTY

p1r473 commented 1 year ago

@p1r473 wrong kitty project you want: https://github.com/cyd01/KiTTY Omg sorry that's embarrassing 🤣🤣