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

cut and paste on chromebook #366

Open
jots opened this issue Jul 24, 2017 · 7 comments
Open

cut and paste on chromebook #366

jots opened this issue Jul 24, 2017 · 7 comments

Comments

@jots
Copy link

jots commented Jul 24, 2017

I have termux running on a chromebook. It works great, but I can't figure out how to cut and paste text between it and the chromebook apps (such as the browser). Is it possible?

@DennisLfromGA
Copy link

@jots,

From the 'User interface' page, use a long press -

The context menu can be shown by long pressing anywhere on the terminal. It provides menu entries for:

Selecting and pasting text.
Sharing text from the terminal to other apps (e.g. email or SMS)
Resetting the terminal if it gets stuck.
Switching the terminal to full-screen.
Hangup (exiting the current terminal session).
Styling the terminal by selecting a font and a color scheme.
Showing this help page.

I'm using a Chromebook too and had to look it up just recently :)

Hope this helps,
-DennisL

@cloudbring
Copy link

I can long press and highlight text but, I can't seem to figure out how to copy it. CTRL+C doesn't work, long pressing again after highlighting doesn't seem to do anything. I'm specifically on a chromebook (Samsung Chromebook Pro) and trying this both with the touch screen (doesn't register any presses in Termux) and using the touche pad (registers the long press).

I would merely like to be able to copy and paste from a Termux screen into a webpage.

@gordol
Copy link

gordol commented Sep 29, 2017

if you use tmux, you can set it up to use a shell script to copy data to/from your buffers.

like so:

~/Bin » cat pbcopy
termux-clipboard-set $1
~/Bin » cat pbpaste
termux-clipboard-get
~/Bin » cat ~/.tmux.conf|grep pb
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"

You can also do something like this:

bind C-y run "tmux show-buffer | pbcopy"
bind C-p run "pbpaste | tmux load-buffer - && tmux paste-buffer"

But the copy-mode line above should work fine, and you can use ctrl+alt+v to paste.

Anyway, even with just those pbcopy and pbpaste scripts (modeled after the same commands on OSX) you can just echo things into the clipboard, but integrating it with tmux so you can grab text off the screen works pretty well.

The alternative is to use SSH via the "secure shell" app and then you can copy by selecting text, and paste by "middle mouse" or 3-finger-tap. Also, selecting text, and pasting with 3 finger tap also works on termux directly too.

@mdeguzis
Copy link

mdeguzis commented Jun 16, 2018

Note that for the above scripts to be sourced properly without extra work, place them in $PREFIX/bin.

cp pbcopy pbpaste $PREFIX/bin
chmod +x $PREFIX/bin/pbcopy
chmod +x $PREFIX/bin/pbpaste

I placed this logic in my tmux.conf:

cat ~/.tmux.conf | grep -A 4 pbcopy
# This assumes you have copied pbcopy/pbpaste into $PREFIX/bin from the github bin/ dir
# clipboard
if-shell "if [[ "$(uname -o)" = "Android" ]]; then \
    bind-key C-y copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"; \
  else  \
    bind-key -t vi-copy 'v' begin-selection; \
    bind-key -t vi-copy 'y' copy-selection; \
  fi"

@grantbow
Copy link

termux-api must be installed in order to have termux-clipboard-* commands

@nachoman42
Copy link

From the Termux help, the Hardware Keyboard entry states:

The following shortcuts are available when using Termux with a hardware (e.g. bluetooth) keyboard by combining them with Ctrl+Alt:

‘C’ → Create new session
‘R’ → Rename current session
Down arrow (or ‘N’) → Next session
Up arrow (or ‘P’) → Previous session
Right arrow → Open drawer
Left arrow → Close drawer
‘M’ → Show menu
‘U’ → Select URL
‘V’ → Paste
+/- → Adjust text size
1-9 → Go to numbered session

So CTRL-ALT-V pastes (which I've confirmed), but oddly nothing for copy.

@ChocolateLoverRaj
Copy link

Why isn't Ctrl+Shift+V paste?

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

8 participants