1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-12 15:34:50 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
bretello
273a49d6b3
Merge a62e4f0339 into 72acd2ca90 2025-12-08 08:33:14 -08:00
bretello
a62e4f0339
feat(clipboard): tmux: send clipboard to client when using clipcopy
From `man tmux`:

```
load-buffer [-w] [-b buffer-name] [-t target-client] path
             (alias: loadb)
       Load the contents of the specified paste buffer from path.
       If -w is given, the buffer is also sent to the clipboard
       for target-client using the xterm(1) escape sequence,
       if possible.  If path is ‘-’, the contents are read from stdin.
```

By adding '-w', we can get `load-buffer` (and `clipcopy`) to also send
the copied buffer to the client, allowing for easy copying tmux buffers
into the local client, which is useful in scenarios such as ssh+tmux
remote sessions.
2025-11-28 10:53:01 +01:00

View File

@ -82,7 +82,7 @@ function detect-clipboard() {
function clipcopy() { cat "${1:-/dev/stdin}" | termux-clipboard-set; }
function clippaste() { termux-clipboard-get; }
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clipcopy() { tmux load-buffer -w "${1:--}"; }
function clippaste() { tmux save-buffer -; }
else
function _retry_clipboard_detection_or_fail() {