atom-terminal-tab icon indicating copy to clipboard operation
atom-terminal-tab copied to clipboard

Copy/paste

Open emersion opened this issue 6 years ago • 7 comments

(I couldn't re-open #9 for some reason)

Currently it's possible to select text, but not to copy it on Linux/Windows. The Ctrl C keyboard shortcut doesn't work since it's captured by the terminal to stop the current job. The right-click menu doesn't offer a "Copy" item.

What needs to be done:

  • Add a keyboard shortcut to copy the currently selected text and paste (Ctrl Shift C/V is a popular default)
  • Add a menu item in the right-click menu to copy and paste

emersion avatar Feb 11 '18 17:02 emersion

My next focus of work is going to be on key bindings and compatibility. See #66 where I will be tracking this work. Thanks!

jsmecham avatar Feb 12 '18 00:02 jsmecham

It looks like copy/paste/clear commands have been in the plugin from the start, just not mapped for non-Mac platforms. I added this to my keymap, and now this is a 💎 of a terminal plugin:

'terminal-view':
  'ctrl-shift-c': 'terminal:copy'
  'ctrl-shift-v': 'terminal:paste'
  'ctrl-shift-k': 'terminal:clear'

cemerick avatar Mar 21 '18 10:03 cemerick

Maybe this can just be added to default keybindings?

terminal:copy doesn't work for me.

emersion avatar Mar 21 '18 10:03 emersion

didnt work for me... i get "Uncaught TypeError: activeSession.copySelection is not a function"

itamarkonimbo avatar Apr 26 '18 10:04 itamarkonimbo

Why is it that the following does not work? 'terminal-view': 'ctrl-c': 'terminal:copy' 'ctrl-v': 'terminal:paste'

PetrKryslUCSD avatar Oct 30 '18 02:10 PetrKryslUCSD

This solution works for me now. Should really be the default for Linux and Windows.

emersion avatar Oct 30 '18 07:10 emersion

I support the idea of using ctr+shift as opposed to only ctr to avoid conflicting with terminal shortcuts, not to mention this being a convention for terminals I believe. I also support considering these as out-of-the-box bindings.

More importantly, I would like to draw attention to the issue of a context menu copy-paste functionality, which I found myself expecting to be functional when I first attempted to paste to the terminal.

Edit:

Furthermore, I support the removal of the current positioning-relevant context menu in place of right-click to paste, select-right-click to copy functionality, as id the case with many Linux terminals, and Windows PowerShell and Command Prompt. If not out-of-the-box, at least configurable,

Edit:

It appears that using the bindings provided by @cemerick, I notice that after I have done some work on my terminal, something is causing the bindings to become ineffectual. One command I definitely used some time before each instance I noticed this is tput reset && printf "\e[3J", because I use it frequently, though this may be unrelated.

rzjnzk avatar Dec 19 '18 10:12 rzjnzk