Skip to content
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

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

Open
cnst opened this issue Jul 25, 2022 · 2 comments
Open

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

cnst opened this issue Jul 25, 2022 · 2 comments

Comments

@cnst
Copy link

cnst commented Jul 25, 2022

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?

  • Terminal in MacOS has pbcopy and pbpaste; plus the fn function key to disable sending the mouse events through the emulated terminal, to make it possible to do local copy/paste using the scrollback of the Terminal app itself;
  • Termux in Android has termux-clipboard-set and termux-clipboard-get (works even in ChromeOS once termux-api.apk is installed in addition to the main apk);
  • Cygwin on Windows has /dev/clipboard; plus you can use the Shift key to avoid sending the mouse events through the terminal, in order to do a local copy-on-select of what's already rendered;
  • is there anything at all with similar functionality for startcli in Crouton on a Chromebook?

Per rpwoodbu/mosh-chrome#190 (comment), 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
Copy link

TomTravis commented Jul 25, 2022

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants