kovidgoyal/kitty

Text selection with zsh `reset-prompt`

m12y opened this issue · 3 comments

m12y commented

I have my zsh config set up to refresh the prompt at regular intervals using reset-prompt. However whenever this refresh occurs, any text I have selected with my mouse in the kitty terminal becomes deselected. This occurs on both macOS (14.4.1) and Arch Linux. This does not occur in other terminal applications I've tried on macOS (default terminal application, iTerm) or Linux (alacritty), using the same zsh config.

Steps to reproduce the behavior:

  1. Use latest version of kitty with default config
  2. Use zsh with ~/.zshrc as
TRAPALRM() { zle .reset-prompt } # refresh prompt
TMOUT=1 # invoke TRAPALRM every second
  1. Select any text in the terminal. It will quickly become deselected, preventing copying for example.

This is by design, when the text in the screen changes selections are
cleared as they may no longer reflest the originally selected text.

m12y commented

Thanks for your reply. Is there any workaround or possibility to change this behaviour via config? It does make text selection unusable unlike the other terminal emulators I mentioned above.

m12y commented

@kovidgoyal Thank you for the quick fix!