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

Console command for interacting with Chromium OS clipboard #2169

Closed jbaum98 closed 2 years ago

jbaum98 commented 9 years ago

Right now, if you are using the regular Secure Shell and enter-chroot, croutonurlhandler doesn't work. Also, there is no way to synchronize the Chrome OS clipboard with the clipboard inside the chroot, for use with vim or emacs clipboard integration. Can these features be implemented, or do they rely too heavily on X?

dnschneid commented 9 years ago

See #2113 for the first item. I'm not sure what you want for the second item, since vim/emacs without X11 have their own internal buffers that aren't synchronized via any standard.

jbaum98 commented 9 years ago

Thanks for the quick response. I guess I meant getting xclip or some equivalent to work in the console, and it would be easy to have that command talk to whatever other programs.

dnschneid commented 9 years ago

Ohhh, that makes sense. Basically, we need to add xclip-like -i and -o parameters to croutonclip.

jbaum98 commented 9 years ago

Yeah, that work even without X, from enter-chroot in secure shell. xclip actually works if I do xiwi uxterm.

On Sun, Oct 11, 2015, 02:22 David Schneider notifications@github.com wrote:

Reopened #2169 https://github.com/dnschneid/crouton/issues/2169.

— Reply to this email directly or view it on GitHub https://github.com/dnschneid/crouton/issues/2169#event-432288818.

acornejo commented 7 years ago

I hacked up something in go to do what I needed (of course it requires the crouton chrome extension installed), but since it doesn't have a dedicated server process it has a high latency (depends on the extension reconnecting to the server).

I could refactor slightly to have a long running server to which I communicate with using named pipes, but I presume croutonclip is already doing something like this?

In case its useful to others, here is what I came up with so far:

https://gist.github.com/acornejo/763f8540dd01090955f3ddcbfee55d42

acornejo commented 7 years ago

I've since put it in a proper repo and updated it to use a long running process to avoid any lag, works well enough for me, perhaps its useful to others:

https://github.com/acornejo/croshclip

eyqs commented 7 years ago

Is this also addressed by https://github.com/zwhitchcox/crouton-clipboard? I think this should be closed.

rackstraw commented 7 years ago

Examine the FAQ for "Secure Shell". It has a link to a utility program called "osc52.sh" which copies from stdin to the system clipboard, up to 100K chars.

$ echo foo bar | osc52.sh

$ cat | osc52.sh There was a young person from Ride Who had a most practical side ^D

$ cat somefile | osc52.sh

$ vim path/to/somefile :! cat % | osc52.sh

trusktr commented 7 years ago

How do we use croutonclip? When I try to pipe something to it (like with xclip), it just seems to run indefinitely.

trusktr commented 7 years ago

More specifically, if we have croutonclip installed inside enter-chroot, how do we get Vim/NeoVim to actually yank to the Chrome OS clipboard?

trusktr commented 7 years ago

Hmmm, I'm getting somewhere. If I let it run for a while, it says

❯ croutonclip
Timeout waiting for extension to connect.
Cannot open /sys/class/tty/tty0/active: No such file or directory
rackstraw commented 7 years ago

I gave up on all that, and use Secure Shell - logging into "username@localhost" - together with the osc52.sh utility that comes with Secure Shell, in order to copy text to the system clipboard.

On Fri, Oct 13, 2017 at 1:04 AM, Joe Pea notifications@github.com wrote:

Hmmm, I'm getting somewhere. If I let it run for a while, it says

❯ croutonclip Timeout waiting for extension to connect. Cannot open /sys/class/tty/tty0/active: No such file or directory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dnschneid/crouton/issues/2169#issuecomment-336351269, or mute the thread https://github.com/notifications/unsubscribe-auth/Acvoi2fOjON-IwFVkMuGNUgseU82kWYJks5sru9fgaJpZM4GLAgq .

trusktr commented 7 years ago

Ah, cool, got croshclip working (needed Crouton Chrome plugin). I'm still not sure how croutonclip works though, but croshclip meets the need!