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 shape changed to block shape after entering some command #4445

Closed Kritiqual closed 2 years ago

Kritiqual commented 2 years ago

Describe the bug Cursor shape changed to block shape after entering some command

To Reproduce Steps to reproduce the behavior:

  1. Cursor shape before is set to beam
  2. Type some command, e.g pacman -Syu
  3. After pressing enter, cursor shape changed to "block" shape

Screenshots Before: image

After: image

Environment details

kitty 0.24.0 created by Kovid Goyal
Linux Archlinux 5.15.12-arch1-1 #1 SMP PREEMPT Wed, 29 Dec 2021 12:04:56 +0000 x86_64
Arch Linux 5.15.12-arch1-1 (pts1)

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/kritiqual/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style      (True, False)
clipboard_control          ('write-clipboard', 'write-primary')
cursor_shape               2
cursor_stop_blinking_after 5.0
cursor_text_color          None
enable_audio_bell          False
font_family                MesloLGS NF
hide_window_decorations    1
input_delay                1
repaint_delay              3
scrollback_lines           1000
tab_bar_style              powerline
tab_title_template         {index}: {title}
update_check_interval      24.0
Changed mouse actions:
     b1 -2 ungrabbed mouse_click_url_or_select
     shift+b1 -2 ungrabbed mouse_click_url_or_select
     shift+b1 -2 grabbed mouse_click_url_or_select
     shift+ctrl+b1 repeat ungrabbed mouse_click_url
     shift+ctrl+b1 repeat grabbed mouse_click_url
Added shortcuts:
    shift+super+w close_os_window
Colors:
    active_tab_background      #f8f8f2   
    active_tab_foreground      #282a36   
    background                 #282a36   
    color0                     #21222c   
    color1                     #ff5555   
    color10                    #69ff94   
    color11                    #ffffa5   
    color12                    #d6acff   
    color13                    #ff92df   
    color14                    #a4ffff   
    color2                     #50fa7b   
    color3                     #f1fa8c   
    color4                     #bd93f9   
    color5                     #ff79c6   
    color6                     #8be9fd   
    color7                     #f8f8f2   
    color8                     #6272a4   
    color9                     #ff6e6e   
    cursor                     #f8f8f2   
    foreground                 #f8f8f2   
    inactive_tab_background    #6272a4   
    inactive_tab_foreground    #282a36   
    mark1_background           #ff5555   
    mark1_foreground           #282a36   
    selection_background       #44475a   
    selection_foreground       #ffffff   
    url_color                  #8be9fd   
kovidgoyal commented 2 years ago

That's by design. The beam cursor is meant for editing at the prompt. Commands get the default cursor shape.

Kritiqual commented 2 years ago

Even after go back to the normal prompt, the cursor shape is still a block. Can I set it to a beam permanently?

kovidgoyal commented 2 years ago

I cannot replicate that, provide a minimal bashrc and set of steps to reproduce.

Kritiqual commented 2 years ago
  1. This is my normal .bashrc
  2. This line is new in my local .bashrc
    # BEGIN_KITTY_SHELL_INTEGRATION
    if test -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; then source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; fi
    # END_KITTY_SHELL_INTEGRATION
  3. Step to reproduce:
    • Open kitty, this is newly open kitty: image
  1. I think the kitty shell integration has some problem, so I disable it in kitty.conf and remove the line in "2", the cursor is normal like before
  2. Kitty debug information
page-down commented 2 years ago

Are you running bash in bash? Then you need to enable shell integration manually. Otherwise it will not work.

Automatic shell integration is only enabled for shells run directly by kitty.

https://sw.kovidgoyal.net/kitty/shell-integration/#manual-shell-integration