-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy/paste, SSH, Tmux #1569
Comments
I should add something else. Micro uses the xclip 'clipboard' selection, whereas xclip on the command line defaults to 'primary'. Therefore, we find it most convenient to create these alias:
This basically unifies copy/paste between micro, your remote command line, tmux and your local system. |
Quick tip. Using the above setup, there is a slight, but significant, delay when pasting in Micro (i guess due to various layers the paste is having to go through). You can avoid this by just using the 'terminal level' paste key combo: shift+ctrl+v. This pastes instantly. |
Ive now patched the author's clipboard package to work very nicely with the tmux buffers - I believe this is the best solution for tmux users. Im using it on a daily basis and it appears to work very well. I'll open a PR. |
Thanks for the instructions, it helped me. Just a note that |
Thank you for this. |
I’m looking for something like this, did you get around to submitting the PR? I couldn’t find it. |
I found another solution for this problem when you have X server running on a remote machine.
on remote machine via SSH I get This is a hint actually. I did:
And micro copy-paste works good. Try it. Years of pain are gone:) Another task is to find a work around the problem without X server running and without X server forwarding. |
Another solution (now it works without X11 running). All info is here: https://github.com/tmux/tmux/wiki/Clipboard set-option -g set-clipboard on This will allow external programs like micro to fill clipboard. Works awesome. |
My original message 18 Jan. 2023:
Using Ctrl + Shift + V speeds up paste time, but there is still a pretty significant delay in Update 25 Jan. 2023:Copy/paste is fast over ssh until I do In my experimenting, Update again: here is a detailed write-up of my solution:How to copy/paste to/from a remote machine running micro over ssh to/from your local machine |
@jpincas , did you open a PR? |
It turns out |
I'm putting this here in the hope that it will help others in a similar situation. We're going all in on Micro for our shared cloud development environment and wanted to get copy/paste working well. After reading the micro help docs, stackoverflow etc, we finally came up with the following solution to get Micro over SSH inside tmux all working nicely. We're using Ubuntu on our local machines, as well as on the server:
.ssh/config
on your local machineForwardX11 yes
echo "test" | xclip
thenxclip -o
xclip -o
on your remote tmux sessionecho "something" | xclip
and paste it somewhere on your local machineThe text was updated successfully, but these errors were encountered: