-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync tmux clipboard and system clipboard
When copying, also write the content into the system clipboard. When pasting, request tmux to refresh its paste buffer from the system clipboard, wait for the update to propagate and the request the clipboard content from tmux. With `set -g set-clipboard on` in tmux, this enables sharing the system clipboard with a helix running in tmux, running in an ssh session, running in alacritty. The need for a wait is unfortunate, but I didn't find a better way. Tmux asks the terminal for the clipboard content and updates its buffer after it got an answer. The answer may come or may not. It may take long, e.g. when running through a slow ssh connection. The feature works well on alacritty. On konsole, it doesn't do anything, but doesn't harm either. On xterm, `tmux refresh-client -l` prints gibberish for me, also without using helix, so I added an option to disable this feature.
- Loading branch information
Showing
3 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters