Open euforic opened 2 years ago
Clipboard of what?
An example would be if I copied something from vim (in vm) then wanted to paste into safari (on my Mac). For qemu ui based vms they usually leverage Spice tools for this.
Are you using something other than the regular terminal application, to access your limactl shell
?
Nope just iterm2 and then directly into lima shell
I was thinking that it would have the usual "select text" and copy/paste functions, but am missing something...
I was thinking that it would have the usual "select text" and copy/paste functions, but am missing something...
It does, and it works fine if you use iTerm copy/paste functionality.
@euforic Are you using vim commands to copy into the clipboard? That will not work because the Linux vim is not connected to the macOS clipboard. But if you select the text using iTerm and copy via ⌘C, then it works fine.
This plugin looked interesting: https://github.com/ojroques/vim-oscyank
anders@lima-default:~$ more .vimrc
call plug#begin()
Plug 'ojroques/vim-oscyank'
call plug#end()
anders@lima-default:~$ vim --version | head -1
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov 08 2021 14:17:01)
:PlugInstall
(https://github.com/junegunn/vim-plug/wiki/tutorial)
:OSCYank
But still controversial: https://gitlab.gnome.org/GNOME/vte/-/issues/2495
Did work in "kitty", but does not work in GNOME Terminal (default settings).
I will dig a little deeper into my config make sure its not something on my end. Thank you for the help 🤙🏽. Also thank you for this project it is awesome. All the work is truly appreciated 🙏🏼
I was thinking that it would have the usual "select text" and copy/paste functions, but am missing something...
It does, and it works fine if you use iTerm copy/paste functionality.
@euforic Are you using vim commands to copy into the clipboard? That will not work because the Linux vim is not connected to the macOS clipboard. But if you select the text using iTerm and copy via ⌘C, then it works fine.
Yeah I am using the system clipboard and was trying to bridge the linux system clipboard with the Mac OS system clipboard similar to how UTM does it with the Spice tools
https://iterm2.com/documentation-utilities.html - see it2copy
Copies text to the pasteboard. Works over ssh. Accepts either standard input or a named file.
It turns out (and TIL), sharing clipboard isn't a straight forward thing to make it happen (at least via SSH, X11 forwarding seems to be the promising way to do so though). So I was able to make it work via that way.
This requires installing XQuartz and X11 forwarding (which is described in the gist) and I chose to SSH to lima guest via ssh
(but this requires additional authentication setup - like adding public key to authorized_keys
on lima) instead of lima
since that's the way I know at the moment. But lima configuration yaml also seems to support ssh configuration there, so you might get lucky with that.
Although it's not an auto magic way that lima just comes with, but I'm quite satisfied with the way it works at the moment.
Currently I am trying to share the system clipboard between host and vm to allow for easier copy and pasting.