kovidgoyal / kitty

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

Cursor jumps to end of line #4808

Closed AirOnSkin closed 2 years ago

AirOnSkin commented 2 years ago

Describe the bug The cursor in kitty sometimes jumps to the end of the line even if no key on the keyboard is pressed. It seems to happen more often when using left click with the mouse on the kitty window. This auto jump to the end of the line sometimes happens when I'm still typing, which can result in invalid commands (one example is exitxit instead of exit -> I press e, the cursor jumps and I finish with xit 🙃). I thought the issue might have something to do with ZSH autosuggestions, but the auto jump can happen even when no suggestion is active.

To Reproduce Steps to reproduce the behavior:

  1. Type command/string into kitty prompt
  2. Place cursor at the start/somewhere in the middle of the command/string
  3. Left click with the mouse on the kitty window
  4. Cursor auto jumps to the end of the line

Screenshots kitty

Environment details

kitty 0.24.4 created by Kovid Goyal
Linux james 5.16.12-arch1-1 #1 SMP PREEMPT Wed, 02 Mar 2022 12:22:51 +0000 x86_64
Arch Linux 5.16.12-arch1-1 (/dev/tty)

Running under: X11
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/bash
Loaded config files:
  /home/james/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style   (True, False)
background_opacity      0.85
bell_on_tab             
bold_font               Meslo LG S for Powerline Bold
bold_italic_font        Meslo LG S for Powerline Bold Italic
copy_on_select          clipboard
cursor_shape            3
editor                  /usr/bin/vim
enable_audio_bell       False
enabled_layouts         ['splits']
font_family             Meslo LG S for Powerline
inactive_tab_font_style (True, False)
initial_window_height   (1260, 'px')
initial_window_width    (2320, 'px')
italic_font             Meslo LG S for Powerline Italic
remember_window_size    False
scrollback_lines        100000
shell                   /usr/bin/zsh --login
shell_integration       frozenset({'no-cursor'})
tab_bar_style           powerline
tab_title_template      {title}
update_check_interval   24.0
url_prefixes            ('http', 'https')
url_style               1
window_alert_on_bell    False
window_border_width     (1.0, 'px')
Added shortcuts:
    shift+left → move_window left
    shift+right → move_window right
    shift+up → move_window up
    shift+down → move_window down
    ctrl+left → neighboring_window left
    ctrl+right → neighboring_window right
    ctrl+up → neighboring_window up
    ctrl+down → neighboring_window down
    ctrl+shift+f3 → launch --location=vsplit
    ctrl+shift+f4 → launch --location=hsplit
    super++ → change_font_size all +2.0
    super+, → edit_config_file
    super+- → change_font_size all -2.0
    super+0 → change_font_size all 0
    super+1 → first_window
    super+2 → second_window
    super+3 → third_window
    super+4 → fourth_window
    super+5 → fifth_window
    super+6 → sixth_window
    super+7 → seventh_window
    super+8 → eighth_window
    super+9 → ninth_window
    super+= → change_font_size all +2.0
    super+n → new_os_window
    super+r → start_resizing_window
    super+t → new_tab
    super+w → close_tab
    super+enter → new_window
    super+up → scroll_line_up
    super+down → scroll_line_down
    super+page_up → scroll_page_up
    super+page_down → scroll_page_down
    super+home → scroll_home
    super+end → scroll_end
    shift+super+- → change_font_size all -2.0
    shift+super+= → change_font_size all +2.0
    shift+super+[ → previous_tab
    shift+super+] → next_tab
    shift+super+d → close_window
    shift+super+i → set_tab_title
    shift+super+w → close_os_window
    alt+super+, → debug_config
    alt+super+r → clear_terminal reset active
    alt+super+page_up → scroll_line_up
    alt+super+page_down → scroll_line_down
    ctrl+super+space → kitten unicode_input
    ctrl+super+, → load_config_file
Changed shortcuts:
    ctrl+shift+kp_subtract → change_font_size all -1.0
    ctrl+shift+kp_add → change_font_size all +1.0
Colors:
    active_border_color     #303030   
    active_tab_background   #9580ff   
    active_tab_foreground   #121212   
    color1                  #ff5555   
    color10                 #5af78e   
    color11                 #f4f99d   
    color12                 #caa9fa   
    color13                 #ff92d0   
    color14                 #9aedfe   
    color15                 #e6e6e6   
    color2                  #50fa7b   
    color3                  #f1fa8c   
    color4                  #bd93f9   
    color5                  #ff79c6   
    color6                  #8be9fd   
    color7                  #bfbfbf   
    color8                  #4d4d4d   
    color9                  #ff6e67   
    cursor                  #666666   
    foreground              #ffffff   
    inactive_border_color   #303030   
    inactive_tab_background #ffff80   
    inactive_tab_foreground #121212   
    url_color               #666666   

Important environment variables seen by the kitty process:
    PATH                                /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
    LANG                                en_US.UTF-8
    SHELL                               /bin/bash
    DISPLAY                             :0
    USER                                james
    XDG_SESSION_PATH                    /org/freedesktop/DisplayManager/Session1
    LC_ADDRESS                          en_US.UTF-8
    LC_NAME                             en_US.UTF-8
    LC_MONETARY                         en_US.UTF-8
    XDG_SEAT                            seat0
    XDG_SESSION_DESKTOP                 
    XDG_SESSION_TYPE                    x11
    LC_PAPER                            en_US.UTF-8
    XDG_CURRENT_DESKTOP                 X-Cinnamon
    XDG_SEAT_PATH                       /org/freedesktop/DisplayManager/Seat0
    XDG_SESSION_CLASS                   user
    LC_IDENTIFICATION                   en_US.UTF-8
    LC_TELEPHONE                        en_US.UTF-8
    LC_MESSAGES                         
    LC_MEASUREMENT                      en_US.UTF-8
    XDG_VTNR                            1
    XDG_SESSION_ID                      2
    LC_CTYPE                            en_US.UTF-8
    XDG_RUNTIME_DIR                     /run/user/1000
    LC_TIME                             en_US.UTF-8
    LC_COLLATE                          en_US.UTF-8
    LC_NUMERIC                          en_US.UTF-8

Additional context I get the same behaviour with kitty --config NONE as described above.

kovidgoyal commented 2 years ago

When you click kitty will tell the shell to move the cursor to the clicked to position. If you dont like this, turn it off with https://sw.kovidgoyal.net/kitty/conf/#shortcut-kitty.Click-the-link-under-the-mouse-or-move-the-cursor