jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
2.93k stars 102 forks source link

Custom cursor colors don't work in Kitty #248

Open mystilleef opened 9 months ago

mystilleef commented 9 months ago

General information

- Terminal program: kitty 0.29.2 (xterm-kitty)
- Operating system: Linux (Fedora Linux 38 Workstation Edition)
- ZSH framework: oh-my-zsh master (d3b6f1f)
- ZSH version: zsh 5.9 (x86_64-redhat-linux-gnu)
- ZVM version: zsh-vi-mode 0.10.0

Basic examination

Problem description

Custom cursor colors don't work in kitty.

They work in gnome-terminal.

They also work in tmux running kitty.

However, they don't work in a standalone kitty terminal.

My configuration is as follows:

function zvm_config() {
  ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
  ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK
  ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_UNDERLINE
  ZVM_OPPEND_MODE_CURSOR=$ZVM_CURSOR_UNDERLINE
  local ncur=$(zvm_cursor_style $ZVM_NORMAL_MODE_CURSOR)
  local icur=$(zvm_cursor_style $ZVM_INSERT_MODE_CURSOR)
  local ocur=$(zvm_cursor_style $ZVM_OPPEND_MODE_CURSOR)
  ZVM_NORMAL_MODE_CURSOR=$ncur"\e\e]12;purple\a"
  ZVM_INSERT_MODE_CURSOR=$icur"\e\e]12;red\a"
  ZVM_OPPEND_MODE_CURSOR=$ocur"\e\e]12;yellow\a"
}

Reproduction steps

  1. Install kitty.
  2. Configure custom cursor colors for zvm as shown above in your ~/.zshrc
  3. Launch kitty.

Expected behavior

I expect cursor colors to reflect my customizations in ~/.zshrc.

It looks like this in kitty.

Screenshot from 2023-09-29 20-09-57

It renders properly in gnome-terminal.

Screenshot from 2023-09-29 20-15-02