home icon indicating copy to clipboard operation
home copied to clipboard

Yank script doesn't work for me

Open austinbutler opened this issue 3 years ago • 5 comments

A modified version here does, though: https://github.com/JSteeleIR/dotfiles-public/blob/public/scripts/yank

I'm using Alacritty on a macOS host with tmux running locally and also remotely in a NixOS host.

Opening this issue since your blog seems like practically the source of truth on nested tmux copy/paste 😛 . Maybe there are some improvements worth pulling into your own yank script.

Testing by running echo "Testing" | ./yank.sh on the remote server, then pasting on the local host.

austinbutler avatar Jul 13 '21 01:07 austinbutler

Thanks for your feedback. I'll need to find a macOS host so I can try reproducing this issue. The script you linked to explicitly redirects the escape sequence to $SSH_TTY whereas mine doesn't (because technically, doing that should be redundant). Could you please check whether the latest (updated) version of my script still triggers the problem in your environment?

sunaku avatar Oct 24 '22 04:10 sunaku

Sorry, but I no longer have a Mac laptop for work so I can't test anything.

austinbutler avatar Oct 24 '22 07:10 austinbutler

For others who may stumble across this, try adding the following to your .tmux.conf:

set-window-option -g allow-passthrough on

(Then reload your config with tmux source-file ~/.tmux.conf, or killing and restarting tmux with tmux kill-server; tmux.)

I've submitted pull request #8 to partially address this.

Alternatively, try commenting out this line in yank: test -n "$TMUX" -o -z "${TERM##screen*}" && esc="\033Ptmux;\033$esc\033\\"

JonathanWheeler avatar Jun 23 '23 02:06 JonathanWheeler

Excellent! :ok_hand: Great catch, thank you. :pray: I'll adjust the documentation a bit and merge soon. :nerd_face:

sunaku avatar Jun 24 '23 15:06 sunaku