sunaku / home

🏡 My $HOME directory (dot files & bin scripts)
https://sunaku.github.io/about.html#unix-shell-environment
138 stars 16 forks source link

Yank script doesn't work for me #6

Open austinbutler opened 3 years ago

austinbutler commented 3 years ago

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.

sunaku commented 1 year ago

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?

austinbutler commented 1 year ago

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

JonathanWheeler commented 1 year ago

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\\"

sunaku commented 1 year ago

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

meinzer1899 commented 1 month ago

Came here from your blog post. Issue can be closed? (https://github.com/sunaku/home/commit/67bd04e4587c40691610b8adc7561596c525bcfc)