You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add conditional ctrl+c/v to copy on integrated terminal similar to cmd #8818
feature-requestRequest for new features or functionalityterminalGeneral terminal issues that don't fall under another labelverification-neededVerification of issue is requestedverifiedVerification succeeded
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.
With all options enabled. You can:
Copy paste ctrl + c / v even when a process is running (kills only if no selection)
Always paste ctrl + v (after process ended)
Select text with mouse
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?
Reacted by ZCShou, gfrSE, Alexander Salas Bastidas, bldesign, Alex, Satoshi Azuma a.k.a. ytnobody, k zh, Elahn Ientile and Booneu
Venelin Stoykov (@vstoykov) Insiders currently allows ctrl+shift+c/v on Windows and Linux, this is coming to Stable in a week or so. It also contains a context menu 😃
For Linux you can also use middle click to paste selection into the terminal, use this if you're sticking to stable for the time being.
A change was just made that allows rebinding the terminal commands to anything and they should skip the terminal and work. This means that ctrl+c/v can be bound to copy and paste now, a terminalTextSelected state or similar needs to be implemented before conditional keybindings can work though.
Hey alexandrudima, from what I can see all information around a command's context keys are currently private. Is it possible to expose this so that I can use IContextKeyService.contextMatchesRules to ensure I'm only allow keybindings that have valid when clauses to skip the terminal?
So given a set of command IDs (string[]), I need to get their keybindings (I'm currently using IKeybindingService.lookupKeybindings) in addition to their associated ContextKeyExpr (all hidden from what I can see).
Daniel Imms (@Tyriar) I've read through this issue, but I'm not fully understanding what you mean.
By default xterm interprets and eats up (stop propagation?) all keydown events
You have a hook from xterm in the form of attachCustomKeydownHandler.
If you return false for a keydown event, then xterm will not interpret and not eat up the event.
In consequence, if you return false, we get to interpret and dispatch the event possibly to a command in our world.
So you would like to "find out" ahead of time what the keydown event would do and if it would end up executing a command in a certain set, but without actually executing it now, then you'd return false, and the command would end up being executed by the keybindingsService eventually.
alexandrudima basically yeah, currently if the keybinding pressed matches one of the commands in some list it will pass it through. The problem is when implementing this is that I only want to have ctrl+c skip xterm only if the when property of the command is fulfilled. It's very important this only happens when the when property (terminalTextSelected) because ctrl+c is the keybinding the terminal uses to send SIGINT to the terminal.
feature-requestRequest for new features or functionalityterminalGeneral terminal issues that don't fall under another labelverification-neededVerification of issue is requestedverifiedVerification succeeded
Activity
warpdesign commentedon Jul 7, 2016
+1 that would be nice!
vstoykov commentedon Aug 1, 2016
Terminal shortcuts on Windows, Linux and Mac are different and probably need to be the same for the OS you are using.
Actually currently I'm unable to copy/paste anything to/from VS Code terminal. Right click menu with Copy/Paste options will be helpful.
P.S. Probably the problem that I have is related only to Linux (Ubuntu 14.04)
Tyriar commentedon Aug 1, 2016
Venelin Stoykov (@vstoykov) Insiders currently allows ctrl+shift+c/v on Windows and Linux, this is coming to Stable in a week or so. It also contains a context menu 😃
For Linux you can also use middle click to paste selection into the terminal, use this if you're sticking to stable for the time being.
vstoykov commentedon Aug 1, 2016
Daniel Imms (@Tyriar) thanks for the info. I will wait for now until new stable version is ready.
Tyriar commentedon Aug 8, 2016
A change was just made that allows rebinding the terminal commands to anything and they should skip the terminal and work. This means that ctrl+c/v can be bound to copy and paste now, a
terminalTextSelectedstate or similar needs to be implemented before conditional keybindings can work though.You can try this in Insiders tomorrow.
wclr commentedon Aug 25, 2016
Daniel Imms (@Tyriar)
Yes this is needed if
terminalTextSelectedctr+C should copy the text.I tried in insiders: If I use this config:
{ "key": "ctrl+c", "command": "workbench.action.terminal.copySelection", "when": "terminalTextSelected" } ]I see that keyboard combination for copy changed in the menu

But actually it doesn't work, maybe some other condition not
terminalTextSelected?Tyriar commentedon Aug 25, 2016
Renamed in favour of (@whitecolor) the work in this issue is essentially to add
terminalTextSelected.Implement terminalTextSelected context key
Tyriar commentedon Oct 23, 2016
Hey alexandrudima, from what I can see all information around a command's context keys are currently private. Is it possible to expose this so that I can use
IContextKeyService.contextMatchesRulesto ensure I'm only allow keybindings that have validwhenclauses to skip the terminal?So given a set of command IDs (
string[]), I need to get their keybindings (I'm currently usingIKeybindingService.lookupKeybindings) in addition to their associatedContextKeyExpr(all hidden from what I can see).See cf28f6d#diff-8c4484557359fefa25fe7396aa970c56R119
alexdima commentedon Oct 26, 2016
Daniel Imms (@Tyriar) I've read through this issue, but I'm not fully understanding what you mean.
attachCustomKeydownHandler.Is this what you mean?
Tyriar commentedon Oct 27, 2016
alexandrudima basically yeah, currently if the keybinding pressed matches one of the commands in some list it will pass it through. The problem is when implementing this is that I only want to have ctrl+c skip xterm only if the
whenproperty of the command is fulfilled. It's very important this only happens when thewhenproperty (terminalTextSelected) because ctrl+c is the keybinding the terminal uses to sendSIGINTto the terminal.alexdima commentedon Oct 27, 2016
I've extracted #14603 so we don't forget about it.
wclr commentedon Dec 4, 2016
Didn't forget?
Tyriar commentedon Dec 4, 2016
I actually forgot about the branch I was working on for this, just merged into master!