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

Support copy and paste via keyboard on integrated terminal #6451

Closed
Tyriar opened this issue May 18, 2016 · 17 comments
Closed

Support copy and paste via keyboard on integrated terminal #6451

Tyriar opened this issue May 18, 2016 · 17 comments
Assignees
Labels
feature-request Request for new features or functionality linux Issues with VS Code on Linux terminal General terminal issues that don't fall under another label windows VS Code on Windows issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented May 18, 2016

Integrated terminal master issue: #143

Might need to use custom keybindings, ctrl+c terminates a process. Also it's probably not best to hijack ctrl+shift+c from open in new terminal.

@Tyriar Tyriar added feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label labels May 18, 2016
@Tyriar Tyriar self-assigned this May 18, 2016
@Tyriar Tyriar added this to the June 2016 milestone Jun 7, 2016
@Tyriar
Copy link
Member Author

Tyriar commented Jun 7, 2016

Probably best left for after xterm is adopted.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 13, 2016

Upstream issue blocking configurable copy/paste: xtermjs/xterm.js#118

xterm.js did recently add ctrl+insert to copy and shift+insert to paste in xtermjs/xterm.js#107, so this will be the 'workaround' until xtermjs/xterm.js#118 gets done.

@mniak
Copy link

mniak commented Jun 22, 2016

I'm also facing Issues with ctrl+C and other simmilar copy-paste shortcuts in the integrated terminal on Windows. I'm not sure what would be the best solution to this issue. Some people would enjoy copying and pasting using the default OS keyboard shortcuts, but it would be difficult to break a current running process (except for OS X). I strongly use this shortcut.

I'd rather remove the shortcut indicator in the right-button-menu for copy/paste/cut to avoid misunderstandings.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 27, 2016

Basic support is there for v1.3.0 using:

  • ctrl+insert to copy
  • shift+insert to paste

This will be improved in the future with the ability to specify your preference in keybindings.json.

@bldesign
Copy link

bldesign commented Jul 5, 2016

Maybe integrated terminal can present same feature as native Windows terminal, on Windows.

In the property options there are edition options with the ability to active ctrl shortcuts. It's just what we are talking about. It kills the process only if there is no selection. Cool no? VS Code can do it.

Sorry my preview is in french, but yours certainly looks the same.
terminalpropertiesoptions

With all options enabled. You can:

  1. Copy paste ctrl + c / v even when a process is running (kills only if no selection)
  2. Always paste ctrl + v (after process ended)
  3. Select text with mouse
  4. Select text with keyboard shift + /

You can copy, paste and select text only with keyboard on Windows.
(Both terminal, integrated and not are Microsoft Windows [version 10.0.10586])

Can you expose these options to user preferences?

@Tyriar Tyriar added linux Issues with VS Code on Linux windows VS Code on Windows issues labels Jul 5, 2016
@mniak
Copy link

mniak commented Jul 6, 2016

Killing the process only if there is no selection

A very good idea

@Tyriar
Copy link
Member Author

Tyriar commented Jul 6, 2016

@bldesign @andregsilv nice suggestion, forked to #8818 to be considered after this.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 11, 2016

Proper keybinding support coming in v1.4.0!

Certain key combinations won't work as the terminal will consume them before VS Code has a chance to respond. This is being tracked in #7269

@Tyriar
Copy link
Member Author

Tyriar commented Jul 11, 2016

Reopening as these keybindings should be disabled on Mac since cmd+c and cmd+v work there.

@alexsorokoletov
Copy link

unfortunately ctrl+insert/shift+insert is not the ideal way to have shortcuts on windows. Macbooks don't have insert key.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 13, 2016

@alexsorokoletov cmd+c and cmd+v should work on Mac.

@Tyriar Tyriar closed this as completed in 1930f89 Jul 16, 2016
@alexsorokoletov
Copy link

@Tyriar hardware is mac, however the OS is Windows 10. Sorry for the confusion

@Tyriar
Copy link
Member Author

Tyriar commented Jul 16, 2016

@alexsorokoletov ah, I guess you have to wait until next release then or use the Insiders build for ctrl+shift+c/v.

@superDuperCyberTechno
Copy link

So, it has been implemented, although I cannot seem to change the shortcut. I tried switching it to ctrl+c/ctrl+v without luck. All other custom keybindings work fine.

@Tyriar
Copy link
Member Author

Tyriar commented Aug 8, 2016

@superDuperCyberTechno you can change the keybinding, but you can only change it to certain combinations as the key strokes at handled by the terminal before vscode itself. This is the reason F1 and ctrl+p do no work but ctrl+shift+p works fine. The "fix" for this would be to address #7269 (comment)

@superDuperCyberTechno
Copy link

superDuperCyberTechno commented Aug 8, 2016

Alright, thank you for the explanation. Makes sense that ctrl+c is bound to the cancel action in the console (bash, at least). I'll just stick to the default keybinding for now, then...

@Tyriar
Copy link
Member Author

Tyriar commented Aug 8, 2016

@superDuperCyberTechno I just pushed a fix for #7269 which will landin Insiders tomorrow (or v1.5.0 stable) to allow a set of commands to skip over the shell processing and be handled by VS Code. This means that you can indeed rebind to ctrl+c and ctrl+v if you want, you will not be able to use ctrl+c to cancel the command anymore though and you cannot remap that (outside of maybe remapping in bash if that's possible).

Conditional ctrl+c/v if probably what you really want, this is still open and captured in #8818

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality linux Issues with VS Code on Linux terminal General terminal issues that don't fall under another label windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

5 participants