mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
1.1 KiB
1.1 KiB
zsh-ghostty-copypaste
ghostty users, this zsh plugin allows you to copy / paste a text selected with the keyboard with ctrl+shift+c / ctrl+shift+v.
This is a complement to zsh-shift-select, allowing to copy with {ctrl+}shift+{left,right,up,down,home,end}.
To use it, add ghostty-copypaste to the plugins array of your .zshrc file:
plugins=(... ghostty-copypaste)
Principle
ghosstyallows to copy / paste a text selected with the mouse, but not with the keyboard, because this is an action devoted to a terminal (zsh) and not to a terminal emulator (ghostty).- When no mouse selection is started,
ghosttypasses a Control Sequence Introducer^[[99;6u/^[[118;6utozsh. The plugin binds these CSI to the correct copy / paste functions for X11 or Wayland. - Be careful,
ghosttycan lose focus when copying and pasting because ofxcliporwl-copy/wl-pastein the plugin. If you use it as a context terminal ("quake"), it is best not to close it when it loses focus.