dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.56k stars 1.24k forks source link

unable to copy text from tmux into ChromeOS clipboard in startcli #4780

Open cnst opened 2 years ago

cnst commented 2 years ago

I'm using Crouton with sudo startcli on a Chromebook.

It would seem like there's no way to copy text from within tmux (w/ tmux set -g mouse) running within Crouton and the main ChromeOS pastebuffer?

Per https://github.com/rpwoodbu/mosh-chrome/issues/190#issuecomment-424671367, there's a workaround for tmux that consists of disabling the mouse support (with tmux set -g mouse off), which subsequently lets you perform the local selection with the mouse for an automatic copy-on-selection into ChromeOS; but this workaround is still suboptimal, since the touchpad selection is very limited, error-prone and non-scriptable, plus it's a whole extra step to take to disable and re-enable the mouse support in tmux, emacs or vim, for the duration of each copy operation (plus, it always copies something other than what I actually select).

I've noticed Linux has a bunch of tools around window managers, like xclip, xclipboard (in the x11-apps package), wl-copy/wl-paste (in wl-clipboard) etc, but they don't seem to work within startcli of Crouton, returning X11 or Wayland error messages. I've tried them in Crostini, and they don't return any errors there, but don't seem to share the buffer properly with the main ChromeOS, either.

I've tried Google, but noone seems to have an answer here. Surely there must be a solution for something so basic, right?!

TomTravis commented 2 years ago

it is not clear what you doing and why you just cannot the crosh sh for this it has cut and paste with scroll and adj buffer save chroot does not share cut and paste buffer with the host OS unless configured to do so crouton does not comply with x11 resources or xsession vars it ignore this in the x11 crouton config best i can tell look at the etc/crouton xserv* files to see if you can add resources there you can try xterm in xiwi this seems to work not x11 server Screenshot_2022-07-25_11-13-45

vim run in xfce-terminal

Screenshot_2022-07-25_11-17-44

gnu-emacs open a new window in xiwi Screenshot_2022-07-25_11-20-36

this two programs with run under Crostini start gnu-emacs via cli

you can get the latest version of tmux and see if it run on you config tmux

TomTravis commented 2 years ago

you may with to try vscode like newer tmux with many plugins