Method to suppress the default CTRL+C/CTRL+V mapping specifically for WSL; profile-specific keybindings? #7998

Open
opened 2026-01-31 01:18:10 +00:00 by claunia · 54 comments
Owner

Originally created by @davea1 on GitHub (May 7, 2020).

Editor's Note (@DHowett-MSFT): This may be a good place to track profile-specific keybindings?

With the classic Windows terminal, Ctrl+c and Ctrl+v can be used for copy and paste when working within a Windows shell just as I would expect/prefer. However, when using WSL, this is typically not the case and those keys are available for use by Linux applications such as Vim.

How can I replicate this same behavior with the new Windows Terminal?

Background:
When working specifically within the WSL environment, Vim is my primary editor and the presence of any Ctrl+v mapping effectively blocks the use of blockwise Visual mode (http://vimdoc.sourceforge.net/htmldoc/visual.html#CTRL-V).

Removal of these mappings in a global scope is undesirable since I do not want to lose the use of Ctrl+c and Ctrl+v for copy and paste when working within a Windows shell.

I realize that similar issues have been discussed at length and that any choice here is somewhat of a compromise, but the ability to replicate the current behavior of the classic Windows terminal in this regard is a tradeoff that I find acceptable/desirable.

Originally created by @davea1 on GitHub (May 7, 2020). Editor's Note (@DHowett-MSFT): This may be a good place to track profile-specific keybindings? With the _classic_ Windows terminal, <kbd>Ctrl</kbd>+<kbd>c</kbd> and <kbd>Ctrl</kbd>+<kbd>v</kbd> can be used for copy and paste when working within a Windows shell just as I would expect/prefer. However, when using WSL, this is typically not the case and those keys are available for use by Linux applications such as Vim. How can I replicate this same behavior with the new Windows Terminal? Background: When working specifically within the WSL environment, Vim is my primary editor and the presence of any <kbd>Ctrl</kbd>+<kbd>v</kbd> mapping effectively blocks the use of blockwise Visual mode (http://vimdoc.sourceforge.net/htmldoc/visual.html#CTRL-V). Removal of these mappings in a global scope is undesirable since I do not want to lose the use of <kbd>Ctrl</kbd>+<kbd>c</kbd> and <kbd>Ctrl</kbd>+<kbd>v</kbd> for copy and paste when working within a Windows shell. I realize that similar issues have been discussed at length and that any choice here is somewhat of a compromise, but the ability to replicate the current behavior of the _classic_ Windows terminal in this regard is a tradeoff that I find acceptable/desirable.
claunia added the Issue-FeatureArea-SettingsProduct-Terminal labels 2026-01-31 01:18:10 +00:00
Author
Owner

@davea1 commented on GitHub (May 7, 2020):

This issue is somewhat related to: #5641

@davea1 commented on GitHub (May 7, 2020): This issue is somewhat related to: #5641
Author
Owner

@DHowett-MSFT commented on GitHub (May 15, 2020):

Maybe what we need is profile-specific keybindings. I'm surprised we don't have a workitem for that.

@DHowett-MSFT commented on GitHub (May 15, 2020): Maybe what we need is profile-specific keybindings. I'm surprised we don't have a workitem for that.
Author
Owner

@davea1 commented on GitHub (May 17, 2020):

@DHowett-MSFT This was actually what I had considered as the most obvious solution to this issue, but simply wanted to leave it up to the developers to choose whatever path they were the most comfortable with. Thanks!

@davea1 commented on GitHub (May 17, 2020): @DHowett-MSFT This was actually what I had considered as the most obvious solution to this issue, but simply wanted to leave it up to the developers to choose whatever path they were the most comfortable with. Thanks!
Author
Owner

@adamjstewart commented on GitHub (Jun 3, 2020):

For the vim Ctrl+V use case, would it be possible to do something similar to what we do for Ctrl+C?

Proposed Behavior

Ctrl+C:

  1. When text is selected, copy the text
  2. When no text is selected, send the SIGINT signal to terminate an application

Ctrl+V:

  1. When in vim insert mode, paste copied text
  2. When in vim normal mode, use blockwise visual mode

Possible Workaround

Is there any way to remap the behavior of Ctrl+V in my .vimrc to produce the desired effect right now?

@adamjstewart commented on GitHub (Jun 3, 2020): For the vim <kbd>Ctrl</kbd>+<kbd>V</kbd> use case, would it be possible to do something similar to what we do for <kbd>Ctrl</kbd>+<kbd>C</kbd>? ### Proposed Behavior <kbd>Ctrl</kbd>+<kbd>C</kbd>: 1. When _text is selected_, copy the text 2. When _no text is selected_, send the SIGINT signal to terminate an application <kbd>Ctrl</kbd>+<kbd>V</kbd>: 1. When in vim _insert_ mode, paste copied text 2. When in vim _normal_ mode, use blockwise visual mode ### Possible Workaround Is there any way to remap the behavior of <kbd>Ctrl</kbd>+<kbd>V</kbd> in my `.vimrc` to produce the desired effect right now?
Author
Owner

@motosir commented on GitHub (Jul 18, 2020):

For the vim Ctrl+V use case, would it be possible to do something similar to what we do for Ctrl+C?

Proposed Behavior

Ctrl+C:

1. When _text is selected_, copy the text

2. When _no text is selected_, send the SIGINT signal to terminate an application

Ctrl+V:

1. When in vim _insert_ mode, paste copied text

2. When in vim _normal_ mode, use blockwise visual mode

Possible Workaround

Is there any way to remap the behavior of Ctrl+V in my .vimrc to produce the desired effect right now?

is it possible for terminal to detect if vim is running/current vim mode?

@motosir commented on GitHub (Jul 18, 2020): > > > For the vim Ctrl+V use case, would it be possible to do something similar to what we do for Ctrl+C? > ### Proposed Behavior > > Ctrl+C: > > 1. When _text is selected_, copy the text > > 2. When _no text is selected_, send the SIGINT signal to terminate an application > > > Ctrl+V: > > 1. When in vim _insert_ mode, paste copied text > > 2. When in vim _normal_ mode, use blockwise visual mode > > > ### Possible Workaround > > Is there any way to remap the behavior of Ctrl+V in my `.vimrc` to produce the desired effect right now? is it possible for terminal to detect if vim is running/current vim mode?
Author
Owner

@DHowett commented on GitHub (Jul 18, 2020):

Not generally, no. We would only be able to detect instances of vim.exe and miss all instances of vim in WSL or over SSH (because you can’t inspect the processes inside a virtual machine or on a remote system just through SSH)

@DHowett commented on GitHub (Jul 18, 2020): Not generally, no. We would only be able to detect instances of `vim.exe` and miss all instances of vim in WSL or over SSH (because you can’t inspect the processes inside a virtual machine or on a remote system just through SSH)
Author
Owner

@adamjstewart commented on GitHub (Jul 18, 2020):

Is there any way to remap the behavior of Ctrl+V in my .vimrc to produce the desired effect right now?

I ended up remapping paste to V because I don't use normal visual mode. Place the following in your .vimrc:

nnoremap v <c-v>                                                                                                                          

Replace v with whatever key you want to use instead.

@adamjstewart commented on GitHub (Jul 18, 2020): > Is there any way to remap the behavior of <kbd>Ctrl</kbd>+<kbd>V</kbd> in my `.vimrc` to produce the desired effect right now? I ended up remapping paste to <kbd>V</kbd> because I don't use normal visual mode. Place the following in your `.vimrc`: ```vim nnoremap v <c-v> ``` Replace `v` with whatever key you want to use instead.
Author
Owner

@davea1 commented on GitHub (Jul 20, 2020):

I have found that making use of the Vim <leader> key feature is a great method for defining additional non-breaking key combinations.

Example workaround for Ctrl+v issue within Vim by utilizing the <leader> key:

nnoremap <Leader>v <c-v>

Hopefully, profile-specific keybindings or some other solution to this issue will be implemented soon.

@davea1 commented on GitHub (Jul 20, 2020): I have found that making use of the Vim `<leader>` key feature is a great method for defining additional _non-breaking_ key combinations. Example workaround for <kbd>Ctrl</kbd>+<kbd>v</kbd> issue within Vim by utilizing the `<leader>` key: `nnoremap <Leader>v <c-v>` Hopefully, profile-specific keybindings or some other solution to this issue will be implemented soon.
Author
Owner

@jmoyers commented on GitHub (Aug 14, 2020):

My experience:

  1. I learned ctrl-shift-c/v, muscle memory adjusted after a day or two. Compatible with foreground sigint and vim. Rejoice.
  2. Vim visual mode broke "randomly" and instead ctrl-v now pastes from system clipboard.
  3. It happened to be the same day I installed tmux. I detached tmux. I finally uninstalled tmux. Still have the issue.
  4. After living with it for a day or two, I think to look in the Microsoft Terminal settings file
  5. Find the new keybinds apparently automatically added when I opened it briefly two days ago. Despair. Delete.

Asks:

  1. Don't automatically change settings when opening a file for the first time
  2. Don't break vim with default settings
@jmoyers commented on GitHub (Aug 14, 2020): **My experience:** 1. I learned ctrl-shift-c/v, muscle memory adjusted after a day or two. Compatible with foreground sigint and vim. Rejoice. 2. Vim visual mode broke "randomly" and instead ctrl-v now pastes from system clipboard. 3. It happened to be the same day I installed tmux. I detached tmux. I finally uninstalled tmux. Still have the issue. 4. After living with it for a day or two, I think to look in the Microsoft Terminal settings file 5. Find the new keybinds apparently automatically added when I opened it briefly two days ago. Despair. Delete. **Asks:** 1. Don't automatically change settings when opening a file for the first time 2. Don't break vim with default settings
Author
Owner

@DHowett commented on GitHub (Aug 14, 2020):

I'm confused about this. Terminal doesn't insert key bindings into your settings -- once your settings file is created (at first launch), we aren't going to add new key bindings.

@DHowett commented on GitHub (Aug 14, 2020): I'm confused about this. Terminal doesn't insert key bindings into your settings -- once your settings file is created (at first launch), we aren't going to add new key bindings.
Author
Owner

@jmoyers commented on GitHub (Aug 15, 2020):

From settings.json:

// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection

I deleted the lines following this, so I don't have reference to them. But they bound copy and paste to ctrl-c and ctrl-v.

Prior to clicking Settings, ctrl-v did not paste. Vim visual mode worked.

After the first time I clicked "Settings" from the menu (down chevron), ctrl-v then became paste, vim visual mode broke. I did not understand what happened. I came across a comment in another issue that I can't seem to find that said this was intentional as a compromise. I'll try to find it.

Maybe I encountered a bug or terminal upgraded in some way to change settings from one day to the next (maybe I got a new build automatically, I have no idea).

Edit: here is the thread https://github.com/microsoft/terminal/issues/5641#issuecomment-621186852

Ctrl+C/Ctrl+V are now listed in new user's settings.json file when they create a new settings file.
If they don't like them, it's trivial to just delete them from the file.
Ctrl+Shift+C/Ctrl+Shift+V will still work if the user deletes the Ctrl+C/Ctrl+V bindings from their settings.json

Clearly its a sore subject for people working on the project. All the settings are there, and I was able to fix it after I actually figured out what happened - great! The user experience part was weird and did not make sense, and sounds like it wasn't intended?

@jmoyers commented on GitHub (Aug 15, 2020): From settings.json: ``` // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. // These two lines additionally bind them to Ctrl+C and Ctrl+V. // To learn more about selection, visit https://aka.ms/terminal-selection ``` I deleted the lines following this, so I don't have reference to them. But they bound copy and paste to ctrl-c and ctrl-v. Prior to clicking Settings, ctrl-v did not paste. Vim visual mode worked. After the first time I clicked "Settings" from the menu (down chevron), ctrl-v then became paste, vim visual mode broke. I did not understand what happened. I came across a comment in another issue that I can't seem to find that said this was _intentional_ as a compromise. I'll try to find it. Maybe I encountered a bug or terminal upgraded in some way to change settings from one day to the next (maybe I got a new build automatically, I have no idea). Edit: here is the thread https://github.com/microsoft/terminal/issues/5641#issuecomment-621186852 > Ctrl+C/Ctrl+V are now listed in new user's settings.json file when they create a new settings file. > If they don't like them, it's trivial to just delete them from the file. > Ctrl+Shift+C/Ctrl+Shift+V will still work if the user deletes the Ctrl+C/Ctrl+V bindings from their settings.json Clearly its a sore subject for people working on the project. All the settings are there, and I was able to fix it after I actually figured out what happened - great! The user experience part was weird and did not make sense, and sounds like it wasn't intended?
Author
Owner

@DHowett commented on GitHub (Aug 15, 2020):

Wow, that's definitely not supposed to happen. The user settings template is only supposed to be stomped down on disk if your settings file is nonexistent or empty. Did you lose any other settings?

We've gotten a couple sporadic reports of settings being nuked on save (!), but we've never had enough to go on. If I had to do some psychic debugging, I might guess that an editor locks the file very briefly when opening, and creates a swap/temp file. The creation of that file forces Terminal to re-scan the directory and when it fails to open the file (we should audit our sharing mode!) it declares all is lost and recreates it?

Complete guess, but it could explain settings disappearing when you open them in an editor. Which editor are you using?

@DHowett commented on GitHub (Aug 15, 2020): Wow, that's definitely not supposed to happen. The user settings template is only supposed to be stomped down on disk if your settings file is nonexistent or empty. Did you lose any other settings? We've gotten a couple sporadic reports of settings being nuked on save (!), but we've never had enough to go on. If I had to do some psychic debugging, I might guess that an editor locks the file very briefly when opening, and creates a swap/temp file. The creation of that file forces Terminal to re-scan the directory and when it fails to open the file (we should audit our sharing mode!) it declares all is lost and recreates it? Complete guess, but it could explain settings disappearing when you open them in an editor. Which editor are you using?
Author
Owner

@jmoyers commented on GitHub (Aug 15, 2020):

I hadn't ever opened it before, so I was stock settings. vscode was the editor.

Probably a more mundane explanation. It sounds like I had a misunderstanding about the defaults. If ctrl-v defaults to paste now, I guess there is a non-zero chance that I just hadn't used ctrl-v in vim+microsoft terminal since it changed. I switch back and forth between vscode/vim mac/windows/linux frequently and I was on the insider's build early on.

Sorry about that, disregard.

@jmoyers commented on GitHub (Aug 15, 2020): I hadn't ever opened it before, so I was stock settings. vscode was the editor. Probably a more mundane explanation. It sounds like I had a misunderstanding about the defaults. If ctrl-v defaults to paste now, I guess there is a non-zero chance that I just hadn't used ctrl-v in vim+microsoft terminal since it changed. I switch back and forth between vscode/vim mac/windows/linux frequently and I was on the insider's build early on. Sorry about that, disregard.
Author
Owner

@d3x0r commented on GitHub (Nov 9, 2020):

how do I disable ctrl+c and ctrl+v all together? I commented them out in settings.json, but now they just don't work at all; well that's not true, they fail in the keyboard handler and prevent further keyboard input for 1.5 seconds (1?).

@d3x0r commented on GitHub (Nov 9, 2020): how do I disable ctrl+c and ctrl+v all together? I commented them out in settings.json, but now they just don't work at all; well that's not true, they fail in the keyboard handler and prevent further keyboard input for 1.5 seconds (1?).
Author
Owner

@zadjii-msft commented on GitHub (Nov 9, 2020):

@d3x0r What the heck - that's very unexpected. If they're not in your settings.json, then the Terminal won't be handling them, they should be going straight to the shell. Would you mind filing a separate issue so we could follow-up and investigate to see what's wrong? Thanks!

@zadjii-msft commented on GitHub (Nov 9, 2020): @d3x0r What the heck - that's _very_ unexpected. If they're not in your `settings.json`, then the Terminal won't be handling them, they should be going straight to the shell. Would you mind filing a separate issue so we could follow-up and investigate to see what's wrong? Thanks!
Author
Owner

@d3x0r commented on GitHub (Nov 9, 2020):

I will dig into it; I suspect it's maybe that they were set and are no longer set also...

@d3x0r commented on GitHub (Nov 9, 2020): I will dig into it; I suspect it's maybe that they were set and are no longer set also...
Author
Owner

@andreykaipov commented on GitHub (Dec 27, 2020):

I added the following to my keybindings and vertical selection worked fine again:

{ "command": "unbound", "keys": "ctrl+v" }

I didn't have this keybinding in my Windows Terminal settings back in June, so I guess something changed in between that time (or maybe I just never update my software).

I think the larger issue is this functionality is almost now undocumented, detailed in the following issue https://github.com/MicrosoftDocs/terminal/issues/211. Who knows what else is now undocumented?

@andreykaipov commented on GitHub (Dec 27, 2020): I added the following to my keybindings and vertical selection worked fine again: ``` { "command": "unbound", "keys": "ctrl+v" } ``` I didn't have this keybinding in [my Windows Terminal settings back in June](https://github.com/andreykaipov/home/blob/7d534e5df974de0615bbbfc20129a2dbd4e36e1b/.config/windows.terminal/settings.json#L65-L72), so I guess something changed in between that time (or maybe I just never update my software). I think the larger issue is this functionality is almost now undocumented, detailed in the following issue https://github.com/MicrosoftDocs/terminal/issues/211. Who knows what else is now undocumented?
Author
Owner

@d3x0r commented on GitHub (Dec 27, 2020):

@andreykaipov

    {
      "command": "unbound",
      "keys": "ctrl+c"
    },
    {
      "command": "unbound",
      "keys": "ctrl+v"
    },

seems to work - but I haven't been using terminal because lack of mouse input (I use FAR Manager as a shell on top of the command shell)

@d3x0r commented on GitHub (Dec 27, 2020): @andreykaipov ``` json { "command": "unbound", "keys": "ctrl+c" }, { "command": "unbound", "keys": "ctrl+v" }, ``` seems to work - but I haven't been using terminal because lack of mouse input (I use FAR Manager as a shell on top of the command shell)
Author
Owner

@kushlendramishra commented on GitHub (Feb 19, 2021):

@andreykaipov Unbinding ctrl+c seems to have worked as you specified, but ctrl+v is still pasting. Can you please show where this has to be put in settings.json? I have tried to put the "keybindings" (and also "actions") in the global settings and the "defaults" part of "profiles but to no effect.

@kushlendramishra commented on GitHub (Feb 19, 2021): @andreykaipov Unbinding ctrl+c seems to have worked as you specified, but ctrl+v is still pasting. Can you please show where this has to be put in settings.json? I have tried to put the "keybindings" (and also "actions") in the global settings and the "defaults" part of "profiles but to no effect.
Author
Owner

@zadjii-msft commented on GitHub (Feb 19, 2021):

@kushlendramishra What shell are you using? I believe powershell has special handling for Ctrl+V to also manually paste on Ctrl+V itself, even when it's unbound in the Terminal

@zadjii-msft commented on GitHub (Feb 19, 2021): @kushlendramishra What shell are you using? I believe powershell has special handling for Ctrl+V to also manually paste on Ctrl+V itself, even when it's unbound in the Terminal
Author
Owner

@ghost commented on GitHub (Feb 19, 2021):

Unbinding Ctrl+V works with WSL, however this also breaks pasting from the clipboard history with Win+V, as it tries to send Ctrl+V.

@ghost commented on GitHub (Feb 19, 2021): Unbinding Ctrl+V works with WSL, however this also breaks pasting from the clipboard history with Win+V, as it tries to send Ctrl+V.
Author
Owner

@kushlendramishra commented on GitHub (Feb 21, 2021):

@kushlendramishra What shell are you using? I believe powershell has special handling for Ctrl+V to also manually paste on Ctrl+V itself, even when it's unbound in the Terminal

I use the PwerShell. I use it to ssh to a linux remote and work on that. So what should I do in this case?

@kushlendramishra commented on GitHub (Feb 21, 2021): > @kushlendramishra What shell are you using? I believe powershell has special handling for Ctrl+V to also manually paste on Ctrl+V itself, even when it's unbound in the Terminal I use the PwerShell. I use it to ssh to a linux remote and work on that. So what should I do in this case?
Author
Owner

@jtaseff-gfms commented on GitHub (Apr 20, 2021):

I finally managed to unbind paste... able to get visual block mode in vim over ssh. Weirdly don't have issues with ctrl+c passing through while copy is still mapped.

{ "command": "unbound", "keys": "ctrl+shift+v" }
{ "command": "unbound", "keys": "ctrl+shift+c" }

@jtaseff-gfms commented on GitHub (Apr 20, 2021): I finally managed to unbind paste... able to get visual block mode in vim over ssh. Weirdly don't have issues with ctrl+c passing through while copy is still mapped. ` { "command": "unbound", "keys": "ctrl+shift+v" } ` ` { "command": "unbound", "keys": "ctrl+shift+c" } `
Author
Owner

@d3x0r commented on GitHub (Apr 21, 2021):

I finally managed to unbind paste... able to get visual block mode in vim over ssh. Weirdly don't have issues with ctrl+c passing through while copy is still mapped.

{ "command": "unbound", "keys": "ctrl+shift+v" }
{ "command": "unbound", "keys": "ctrl+shift+c" }

was going to say 'I think you want 'ctrl+shift+v' to get ctrl-shift-v to work... you had only specific ctrl+v... but now with your remaining comment; seems you should just have "ctrl+c" also...

@d3x0r commented on GitHub (Apr 21, 2021): > I finally managed to unbind paste... able to get visual block mode in vim over ssh. Weirdly don't have issues with ctrl+c passing through while copy is still mapped. > > `{ "command": "unbound", "keys": "ctrl+shift+v" }` > `{ "command": "unbound", "keys": "ctrl+shift+c" }` was going to say 'I think you want 'ctrl+shift+v' to get ctrl-shift-v to work... you had only specific ctrl+v... but now with your remaining comment; seems you should just have "ctrl+c" also...
Author
Owner

@spencerharmon commented on GitHub (Apr 28, 2021):

Wow. I dug around in elisp code on my remote machine trying to figure out who enabled CUA mode. Microsoft devs, please don't randomly change my configuration. It's not the first time opening the file in my case. I already had to modify this to set bellStyle to none and cursorShape to filledBox.
Thanks @jmoyers for the explanation.

@spencerharmon commented on GitHub (Apr 28, 2021): Wow. I dug around in elisp code on my remote machine trying to figure out who enabled CUA mode. Microsoft devs, please don't randomly change my configuration. It's not the first time opening the file in my case. I already had to modify this to set bellStyle to none and cursorShape to filledBox. Thanks @jmoyers for the explanation.
Author
Owner

@DHowett commented on GitHub (Apr 28, 2021):

This configuration has not changed in 18 months and almost certainly does not flip itself randomly.

@DHowett commented on GitHub (Apr 28, 2021): This configuration has not changed in 18 months and almost certainly does not flip itself randomly.
Author
Owner

@gpvos commented on GitHub (May 10, 2021):

I hope this is related enough to mention in this issue rather than a new one, but what annoys me (independent of profile) is that shift+ctrl+c, if nothing has been selected, sends an interrupt. If I had wanted to interrupt, I would have typed ctrl+c without shift. Inadvertently interrupting a process can be very disruptive to my workflow. In my memory, this is a new behaviour since a few months, but I might be wrong. So I would like an option to the "copy" action (or a separate action) to NOT default to interrupt if nothing has been selected; in that case, just do nothing.

2021-05-28: Edit: I have created a new issue for this now.

@gpvos commented on GitHub (May 10, 2021): I hope this is related enough to mention in this issue rather than a new one, but what annoys me (independent of profile) is that shift+ctrl+c, if nothing has been selected, sends an interrupt. If I had wanted to interrupt, I would have typed ctrl+c without shift. Inadvertently interrupting a process can be very disruptive to my workflow. In my memory, this is a new behaviour since a few months, but I might be wrong. So I would like an option to the "copy" action (or a separate action) to NOT default to interrupt if nothing has been selected; in that case, just do nothing. 2021-05-28: Edit: I have created a new issue for this now.
Author
Owner

@spencerharmon commented on GitHub (Jun 1, 2021):

Just thought I'd chime in again to say that this behavior randomly changed again (but not my profile.json). Without explicitly defining the bindings, ctrl+shift+c started sending SIGINT. Very frustrating.

@spencerharmon commented on GitHub (Jun 1, 2021): Just thought I'd chime in again to say that this behavior randomly changed again (but not my profile.json). Without explicitly defining the bindings, ctrl+shift+c started sending SIGINT. Very frustrating.
Author
Owner

@jtaseff-gfms commented on GitHub (Jun 1, 2021):

Just thought I'd chime in again to say that this behavior randomly changed again (but not my profile.json). Without explicitly defining the bindings, ctrl+shift+c started sending SIGINT. Very frustrating.

Just yesterday one of my devices decided to stop pasting on right click, no clue what changed or how to get it back. Now it does some combination of messing up the last few minutes of typing

@jtaseff-gfms commented on GitHub (Jun 1, 2021): > Just thought I'd chime in again to say that this behavior randomly changed again (but not my profile.json). Without explicitly defining the bindings, ctrl+shift+c started sending SIGINT. Very frustrating. Just yesterday one of my devices decided to stop pasting on right click, no clue what changed or how to get it back. Now it does some combination of messing up the last few minutes of typing
Author
Owner

@ghost commented on GitHub (Jun 5, 2021):

For Windows Terminal, if you are in a PowerShell terminal the correct behavior is for Ctrl+v to paste from the clipboard. However, in a WSL terminal this is INCORRECT behavior; the shortcut should be delegated / passed through.

@ghost commented on GitHub (Jun 5, 2021): For Windows Terminal, if you are in a PowerShell terminal the correct behavior is for Ctrl+v to paste from the clipboard. However, in a WSL terminal this is INCORRECT behavior; the shortcut should be delegated / passed through.
Author
Owner

@AndrewSav commented on GitHub (Jun 5, 2021):

@brianmingus2 why do you single out PowerShell? Windows terminal can be used with a plethora of shells/apps, do you suggest that it should detect what's running inside? Given that executables can be easily renamed it does not sound very practical.

@AndrewSav commented on GitHub (Jun 5, 2021): @brianmingus2 why do you single out PowerShell? Windows terminal can be used with a plethora of shells/apps, do you suggest that it should detect what's running inside? Given that executables can be easily renamed it does not sound very practical.
Author
Owner

@ghost commented on GitHub (Jun 5, 2021):

Correct, in the case of WSL it should adopt the prime directive.

@ghost commented on GitHub (Jun 5, 2021): Correct, in the case of WSL it should adopt the prime directive.
Author
Owner

@ghost commented on GitHub (Jun 5, 2021):

^^ As software engineers, lists are our bread and butter. We should not be afraid of making and maintaining lists.

@ghost commented on GitHub (Jun 5, 2021): ^^ As software engineers, lists are our bread and butter. We should not be afraid of making and maintaining lists.
Author
Owner

@spencerharmon commented on GitHub (Jun 7, 2021):

Back again with new behavior. Now, I have explicitly set:

    "actions": 
    [
        // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
        // These two lines additionally bind them to Ctrl+C and Ctrl+V.
        // To learn more about selection, visit https://aka.ms/terminal-selection
        { "command": "paste", "keys": "ctrl+shift+v" },
        { "command": "copy", "keys": "ctrl+shift+c" },

This used to do what you'd expect (copy with ctrl+shift+c and paste with ctrl+shift+v). However, after a reboot I ran into the pinned error about can't find whatever font so I set that explicitly to one that works in the json file (probably irrelevant). Now, when I press ctrl+shift+c OR ctrl+c, it sends SIGINT. I can copy and paste with right-click still. I see yall catch a lot of flak for this and I'm sorry that's the case. This happens to be the best/most configurable terminal I've found for windows, even with this sometimes-works-sometimes-not quirk. Sending good vibes your way and hoping for a fix/workaround.

@spencerharmon commented on GitHub (Jun 7, 2021): Back again with new behavior. Now, I have explicitly set: ``` "actions": [ // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. // These two lines additionally bind them to Ctrl+C and Ctrl+V. // To learn more about selection, visit https://aka.ms/terminal-selection { "command": "paste", "keys": "ctrl+shift+v" }, { "command": "copy", "keys": "ctrl+shift+c" }, ``` This used to do what you'd expect (copy with ctrl+shift+c and paste with ctrl+shift+v). However, after a reboot I ran into the pinned error about can't find whatever font so I set that explicitly to one that works in the json file (probably irrelevant). Now, when I press ctrl+shift+c OR ctrl+c, it sends SIGINT. I can copy and paste with right-click still. I see yall catch a lot of flak for this and I'm sorry that's the case. This happens to be the best/most configurable terminal I've found for windows, even with this sometimes-works-sometimes-not quirk. Sending good vibes your way and hoping for a fix/workaround.
Author
Owner

@spencerharmon commented on GitHub (Jun 7, 2021):

Well.. You know what? I removed the relevant lines above, saved, added them back, saved again, and it works! Hopefully that information will help determine what went wrong.

@spencerharmon commented on GitHub (Jun 7, 2021): Well.. You know what? I removed the relevant lines above, saved, added them back, saved again, and it works! Hopefully that information will help determine what went wrong.
Author
Owner

@IAmIlliest commented on GitHub (Jun 14, 2021):

Just a note on this, make sure you don't have other things interfering with the clipboard that are confounding your testing, as it might not be Windows Terminal that is at fault.

I was trying to bugger off the Ctrl+V and Ctrl+C bindings for Powershell 7, and couldn't work out why it was still pasting with them despite disabling them in Windows Terminal settings. Some further digging, after some initial swearing at WT, made me think that the PSReadLine module that I have installed within PS 7 could be the culprit, as it does indeed have it's own key bindings for copy and paste:
https://github.com/PowerShell/PSReadLine
(That page has commands for listing PSReadLine's key bindings).

If I fire up a different shell within Windows Terminal like CMD or a terminal version of nvim, it does indeed appear that Ctrl+C and Ctrl+V have been unbound from copy and paste by Windows Terminal itself. So just be wary of co-conspirators when it comes to key bindings...

@IAmIlliest commented on GitHub (Jun 14, 2021): Just a note on this, make sure you don't have other things interfering with the clipboard that are confounding your testing, as it might not be Windows Terminal that is at fault. I was trying to bugger off the Ctrl+V and Ctrl+C bindings for Powershell 7, and couldn't work out why it was still pasting with them despite disabling them in Windows Terminal settings. Some further digging, after some initial swearing at WT, made me think that the PSReadLine module that I have installed within PS 7 could be the culprit, as it does indeed have it's own key bindings for copy and paste: https://github.com/PowerShell/PSReadLine (That page has commands for listing PSReadLine's key bindings). If I fire up a different shell within Windows Terminal like CMD or a terminal version of nvim, it does indeed appear that Ctrl+C and Ctrl+V have been unbound from copy and paste by Windows Terminal itself. So just be wary of co-conspirators when it comes to key bindings...
Author
Owner

@ghost commented on GitHub (Jun 14, 2021):

In Windows Terminal Preview I was able to delete the Ctrl+v paste binding under Settings > Actions

@ghost commented on GitHub (Jun 14, 2021): In Windows Terminal Preview I was able to delete the Ctrl+v paste binding under Settings > Actions
Author
Owner

@spencerharmon commented on GitHub (Jul 16, 2021):

Back again. WT started sending sigint even with { "command": "copy", "keys": "ctrl+shift+c" }. I didn't change my config. The workaround above isn't working this time.

@spencerharmon commented on GitHub (Jul 16, 2021): Back again. WT started sending sigint even with `{ "command": "copy", "keys": "ctrl+shift+c" }`. I didn't change my config. The workaround above isn't working this time.
Author
Owner

@spencerharmon commented on GitHub (Jul 16, 2021):

This time, restarting WT resolved the incorrect behavior. That's not a very good outcome.

@spencerharmon commented on GitHub (Jul 16, 2021): This time, restarting WT resolved the incorrect behavior. That's not a very good outcome.
Author
Owner

@spencerharmon commented on GitHub (Jul 16, 2021):

Well never mind, it's doing the other thing again. Is there anything I can provide to help yall debug this? Intermittent bugs like this are hard. I'm not sure how I can help you reproduce the error.

@spencerharmon commented on GitHub (Jul 16, 2021): Well never mind, it's doing the other thing again. Is there anything I can provide to help yall debug this? Intermittent bugs like this are hard. I'm not sure how I can help you reproduce the error.
Author
Owner

@Nimmidev commented on GitHub (Oct 20, 2021):

For everyone that still has trouble with unbinding CTRL+V globally in windows-terminal:

Put this into your settings.json under actions:

{
    "command": "unbound",
    "keys": "ctrl+v"
}

This will unbind CTRL+V for the terminal itself BUT it still works in powershell. This is because PSReadLine is handling the keyboard shortcut. So if you have this problem you need to remove the binding for it:

Remove-PSReadLineKeyHandler -Chord "ctrl+v"
Remove-PSReadLineKeyHandler -Chord "ctrl+v" -ViMode Command
@Nimmidev commented on GitHub (Oct 20, 2021): For everyone that still has trouble with unbinding CTRL+V globally in windows-terminal: Put this into your `settings.json` under `actions`: ```json { "command": "unbound", "keys": "ctrl+v" } ``` This will unbind CTRL+V for the terminal itself **BUT** it still works in powershell. This is because PSReadLine is handling the keyboard shortcut. So if you have this problem you need to remove the binding for it: ```powershell Remove-PSReadLineKeyHandler -Chord "ctrl+v" Remove-PSReadLineKeyHandler -Chord "ctrl+v" -ViMode Command ```
Author
Owner

@Tomicapo commented on GitHub (Mar 21, 2022):

Hi. Sorry if it's not the correct place!
Why can't we have "shift + insert" for pasting in wsl?

@Tomicapo commented on GitHub (Mar 21, 2022): Hi. Sorry if it's not the correct place! Why can't we have "shift + insert" for pasting in wsl?
Author
Owner

@zadjii-msft commented on GitHub (Mar 22, 2022):

@Tomicapo You're more than welcome to add

{ "command": "paste", "keys": "shift+insert" },

to your actions to enable pasting on shift+insert

@zadjii-msft commented on GitHub (Mar 22, 2022): @Tomicapo You're more than welcome to add ``` { "command": "paste", "keys": "shift+insert" }, ``` to your actions to enable pasting on <kbd>shift+insert</kbd>
Author
Owner

@vadimkantorov commented on GitHub (Apr 29, 2022):

Again hit by this, I would argue that for WSL profiles, the default should disable Ctrl+V as Vim is very popular....

@vadimkantorov commented on GitHub (Apr 29, 2022): Again hit by this, I would argue that for WSL profiles, the default should disable Ctrl+V as Vim is very popular....
Author
Owner

@xinloi commented on GitHub (Apr 3, 2023):

Hi,
I am also interested in this feature for SSH.

@xinloi commented on GitHub (Apr 3, 2023): Hi, I am also interested in this feature for SSH.
Author
Owner

@pm100 commented on GitHub (Oct 27, 2023):

its not just WSL, I have a text mode app that wants to receive the ctrl-v key stroke. It has its own idea for what that means

@pm100 commented on GitHub (Oct 27, 2023): its not just WSL, I have a text mode app that wants to receive the ctrl-v key stroke. It has its own idea for what that means
Author
Owner

@pm100 commented on GitHub (Oct 27, 2023):

shouldnt it be that if ENABLE_PROCESSED_INPUT is off then ctrl-v should be ignored? Or could we have another mode bit for paste (ENABLE_PASTE)

@pm100 commented on GitHub (Oct 27, 2023): shouldnt it be that if ENABLE_PROCESSED_INPUT is off then ctrl-v should be ignored? Or could we have another mode bit for paste (ENABLE_PASTE)
Author
Owner

@alex-jitbit commented on GitHub (Nov 22, 2023):

Actually, if there was a simple method to send Ctrl + V to the app just once it would be enough.

My use-case: I use "micro" editor via ssh. And copy-pasting in it is a huge pain in Windows terminal, because it intercepts my input.

PS. disabling the default "Ctrl+V" helps, but offering the above option would still be nice

@alex-jitbit commented on GitHub (Nov 22, 2023): Actually, if there was a simple method to `send Ctrl + V to the app just once` it would be enough. My use-case: I use "micro" editor via ssh. And copy-pasting in it is a huge pain in Windows terminal, because it intercepts my input. PS. disabling the default "Ctrl+V" helps, but offering the above option would still be nice
Author
Owner

@Hobart commented on GitHub (Mar 26, 2024):

Actually, if there was a simple method to send Ctrl + V to the app just once it would be enough.

Using Windows Terminal to run a Cygwin bash shell runs into this problem, the default 'lnext' (literal next character) tty setting is Ctrl-V, which lets you e.g. put control characters into regexps you're typing instead of backslash escapes.

@Hobart commented on GitHub (Mar 26, 2024): > Actually, if there was a simple method to send Ctrl + V to the app just once it would be enough. Using Windows Terminal to run a Cygwin bash shell runs into this problem, the default 'lnext' (literal next character) tty setting is Ctrl-V, which lets you e.g. put control characters into regexps you're typing instead of backslash escapes.
Author
Owner

@daviddwlee84 commented on GitHub (Jul 26, 2024):

I found there are options in the Actions tab that can easily delete the key bindings
image

@daviddwlee84 commented on GitHub (Jul 26, 2024): I found there are options in the Actions tab that can easily delete the key bindings ![image](https://github.com/user-attachments/assets/63b9ec50-f11d-429e-951f-2abf297861f6)
Author
Owner

@taiwork commented on GitHub (Aug 6, 2024):

For the vim Ctrl+V use case, would it be possible to do something similar to what we do for Ctrl+C?

Proposed Behavior

Ctrl+C:

  1. When text is selected, copy the text
  2. When no text is selected, send the SIGINT signal to terminate an application

Ctrl+V:

  1. When in vim insert mode, paste copied text
  2. When in vim normal mode, use blockwise visual mode

Possible Workaround

Is there any way to remap the behavior of Ctrl+V in my .vimrc to produce the desired effect right now?

https://github.com/microsoft/terminal/issues/5790#issuecomment-2252281727
To achieve the desired behavior, follow these steps after removing the <C-v> key binding as mentioned in the link above:

  1. Open your .vimrc file.
  2. Add the following line to remap <C-v> in insert mode to paste the copied text:
inoremap <C-v> <C-r>+

This will allow to paste copied text in insert mode while keeping its default behavior in normal mode.

@taiwork commented on GitHub (Aug 6, 2024): > For the vim Ctrl+V use case, would it be possible to do something similar to what we do for Ctrl+C? > > ### Proposed Behavior > Ctrl+C: > > 1. When _text is selected_, copy the text > 2. When _no text is selected_, send the SIGINT signal to terminate an application > > Ctrl+V: > > 1. When in vim _insert_ mode, paste copied text > 2. When in vim _normal_ mode, use blockwise visual mode > > ### Possible Workaround > Is there any way to remap the behavior of Ctrl+V in my `.vimrc` to produce the desired effect right now? https://github.com/microsoft/terminal/issues/5790#issuecomment-2252281727 To achieve the desired behavior, follow these steps after removing the `<C-v>` key binding as mentioned in the link above: 1. Open your `.vimrc` file. 2. Add the following line to remap `<C-v>` in insert mode to paste the copied text: ```vim inoremap <C-v> <C-r>+ ``` This will allow <C-v> to paste copied text in insert mode while keeping its default behavior in normal mode.
Author
Owner

@rhoog-ine commented on GitHub (Jun 5, 2025):

Proposed Behavior

Ctrl+C:

  1. When text is selected, copy the text
  2. When no text is selected, send the SIGINT signal to terminate an application

Converting ctrl-C into sigint is a function of the termios layer. The running application can configure the termios layer, not 'guestimate' what is the appropriate action depending on what is on screen/selected that is a bad idea!

@rhoog-ine commented on GitHub (Jun 5, 2025): > ### Proposed Behavior > Ctrl+C: > > 1. When _text is selected_, copy the text > 2. When _no text is selected_, send the SIGINT signal to terminate an application Converting ctrl-C into sigint is a function of the termios layer. The running application can configure the termios layer, not 'guestimate' what is the appropriate action depending on what is on screen/selected that is a bad idea!
Author
Owner

@mh166 commented on GitHub (Aug 30, 2025):

Hi everyone,
thanks as always for all the hard work that goes into Windows Terminal. It’s such a great project that makes life on Windows a lot more comfortable! 🙌

@DHowett-MSFT Just curious if there are any updates on the idea of profile-specific keybindings. From what I gathered it seems generally accepted, but I wasn’t sure if it’s just waiting for prioritization or if there are technical/architectural challenges holding it back. No pressure at all, just asking out of interest. Thanks again!

@mh166 commented on GitHub (Aug 30, 2025): Hi everyone, thanks as always for all the hard work that goes into Windows Terminal. It’s such a great project that makes life on Windows a lot more comfortable! 🙌 @DHowett-MSFT Just curious if there are any updates on the idea of profile-specific keybindings. From what I gathered it seems generally accepted, but I wasn’t sure if it’s just waiting for prioritization or if there are technical/architectural challenges holding it back. No pressure at all, just asking out of interest. Thanks again!
Author
Owner

@lhecker commented on GitHub (Sep 1, 2025):

No updates as of yet. We work on a mix of things that interest us personally (e.g. improvements to stability, or the settings UI) as well as issues/workitems that are popular on GitHub. This one is somewhat popular, so I expect it to be worked on sooner than some other issues. There aren't any plans for it yet, though.

@lhecker commented on GitHub (Sep 1, 2025): No updates as of yet. We work on a mix of things that interest us personally (e.g. improvements to stability, or the settings UI) as well as issues/workitems that are popular on GitHub. This one is somewhat popular, so I expect it to be worked on sooner than some other issues. There aren't any plans for it yet, though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7998