Terminal: shift+ins not being recognised as key bindings for paste

Created on 25 Oct 2019  路  14Comments  路  Source: microsoft/terminal

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.418]
Windows Terminal version (if applicable): 0.6.2951

Steps to reproduce

adding shift +ins for paste does not work, while ctrl+shift+v works in profile.json

 "keybindings": [{ "unbound": "nextTab", "keys": ["ctrl+tab"] },
            { "keys": ["Shift+Ins"], "command": "paste" }, //does not work
                    { "keys": ["ctrl+shift+v"], "command": "paste" }  //works

                   ]

Expected behavior


pasting of highlighted text triggered by CopyonSelect

Actual behavior

some terminal control chars ~2 gets printed instead of CopyonSelect text

Area-TerminalControl Issue-Bug Needs-Repro Needs-Tag-Fix Product-Terminal

Most helpful comment

Does shift+insert work as a keybinding? I believe our key for Insert is insert, not Ins.

All 14 comments

Does shift+insert work as a keybinding? I believe our key for Insert is insert, not Ins.

Does shift+insert work as a keybinding? I believe our key for Insert is insert, not Ins.

No, it doesn't. nor any combination of capitalised shift+insert variants.

"keybindings": [{"command": "paste","keys": ["shift+insert"]}],
works for me.

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

Tried this, doesn't work, gives the same 2~ as cli txt instead of highlighted text for paste

Strange question: what keyboard layout are you using?

Strange question: what keyboard layout are you using?

T470 Lenovo laptop, US-eng layout and English-India keyboard layout as shown in Win 10.

Switched kb layout using system tray icons on the right and tried Terminal again; same results.

It works if shift+insert is the only keybind, but if you try having multiple, it doesn't work.

ie.

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

Works, but

            {
                "command" : "paste",
                "keys" : 
                [
                    "ctrl+shift+v",
                    "shift+insert"
                ]
            },

Doesn't

Yes, multiple keys bound to a single command are for _key chording_. You need an individual key binding for each key. When we support chording, you鈥檇 activate a chorded key binding by pressing all of the keys _in sequence_.

It works if shift+insert is the only keybind, but if you try having multiple, it doesn't work.
Works, but

            {
                "command" : "paste",
                "keys" : 
                [
                    "ctrl+shift+v",
                    "shift+insert"
                ]
            },

Doesn't

Tried your suggestion but didn't work for me. see snippet below..
"keybindings": [{ "unbound": "nextTab", "keys": ["ctrl+tab"] }, {"command": "paste","keys": ["shift+insert"]}, //{ "keys": ["shift+insert"], "command": "paste" }, //{ "keys": ["ctrl+shift+v"], "command": "paste" }, { "command": "unbound", "keys": [ "alt+shift+-" ] }, { "command": "unbound", "keys": [ "alt+shift+plus" ] },

@sivaramn right: your issue is one we still can't figure out. "Thor Erik"'s, however, is as stated.

When I paste your keybindings directly into my config file, paste works just fine.

The only ways I can break paste on Shift+Ins is by adding a second empty keybindings elsewhere in the file.

Can you share your entire profiles.json? I realize we've never asked for that. Sorry!

@sivaramn right: your issue is one we still can't figure out. "Thor Erik"'s, however, is as stated.

When I paste your keybindings directly into my config file, paste works just fine.

The only ways I can break paste on Shift+Ins is by adding a second empty keybindings elsewhere in the file.

Can you share your entire profiles.json? I realize we've never asked for that. Sorry!

````

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
"$schema": "https://aka.ms/terminal-profiles-schema",

"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"launchMode": "maximized",
"copyOnSelect": true,

"profiles":
[
    {
        // Make changes here to the powershell.exe profile
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "name": "Windows PowerShell",
        "commandline": "powershell.exe",
        "hidden": false
    },
    {
        // Make changes here to the cmd.exe profile
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "cmd",
        "commandline": "cmd.exe",
        "hidden": false
    },
    {
        "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
        "hidden": false,
        "name": "Ubuntu-18.04",
        "source": "Windows.Terminal.Wsl",
    //"colorscheme": "Campbell",
    //"colorscheme": "Ubuntu",
    //"colorscheme": "UbuntuLegit",
    "colorscheme": "Vintage",
    "copyOnSelect": true,
        "historySize": 9001,
        "snapOnInput": true,
        "cursorColor": "#FFFFFF",
        "cursorShape": "bar",
        "commandline": "wsl ~",
        "fontFace": "Consolas",
        "fontSize": 12,
        "acrylicOpacity": 0.95,
        "useAcrylic": false,
        "closeOnExit": true,
        "padding": "0, 0, 0, 0"
    },
    {
        "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
        "hidden": false,
        "name": "Azure Cloud Shell",
        "source": "Windows.Terminal.Azure"
    }
],

// Add custom color schemes to this array
"schemes": [
        {
        "name": "Campbell",
        "foreground": "#A7B191", 
        "background": "#0C0C0C",
        "colors": [
            "#0C0C0C",
            "#C50F1F",
            "#13A10E",
            "#C19C00",
            "#0037DA",
            "#881798",
            "#3A96DD",
            "#CCCCCC",
            "#767676",
            "#E74856",
            "#16C60C",
            "#F9F1A5",
            "#3B78FF",
            "#B4009E",
            "#61D6D6",
            "#F2F2F2"
        ]
    },
{
  "name": "Solarized Dark",
  "foreground": "#FDF6E3",
  "background": "#073642",
  "colors": [
    "#073642",
    "#D30102",
    "#859900",
    "#B58900",
    "#268BD2",
    "#D33682",
    "#2AA198",
    "#EEE8D5",
    "#002B36",
    "#CB4B16",
    "#586E75",
    "#657B83",
    "#839496",
    "#6C71C4",
    "#93A1A1",
    "#FDF6E3"
  ]
},
{
  "name": "Solarized Light",
  "foreground": "#073642",
  "background": "#FDF6E3",
  "colors": [
    "#073642",
    "#D30102",
    "#859900",
    "#B58900",
    "#268BD2",
    "#D33682",
    "#2AA198",
    "#EEE8D5",
    "#002B36",
    "#CB4B16",
    "#586E75",
    "#657B83",
    "#839496",
    "#6C71C4",
    "#93A1A1",
    "#FDF6E3"
  ]
},
{
  "name": "Ubuntu",
  "foreground": "#EEEEEC",
  "background": "#2C001E",
  "colors": [
    "#EEEEEC",
    "#16C60C",
    "#729FCF",
    "#B58900",
    "#268BD2",
    "#D33682",
    "#2AA198",
    "#EEE8D5",
    "#002B36",
    "#CB4B16",
    "#586E75",
    "#657B83",
    "#839496",
    "#6C71C4",
    "#93A1A1",
    "#FDF6E3"
  ]
},
{
  "name": "UbuntuLegit",
  "foreground": "#EEEEEE",
  "background": "#2C001E",
  "colors": [
    "#4E9A06",
    "#CC0000",
    "#300A24",
    "#C4A000",
    "#3465A4",
    "#75507B",
    "#06989A",
    "#D3D7CF",
    "#555753",
    "#EF2929",
    "#8AE234",
    "#FCE94F",
    "#729FCF",
    "#AD7FA8",
    "#34E2E2",
    "#EEEEEE"
  ]
}

]
}],

// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": [{ "unbound": "nextTab", "keys": ["ctrl+tab"] },
        {"command": "paste","keys": ["shift+insert"]},
        //{ "keys": ["shift+insert"], "command": "paste" },
                //{ "keys": ["ctrl+shift+v"], "command": "paste" },
        { "command": "unbound", "keys": [ "alt+shift+-" ] },
            { "command": "unbound", "keys": [ "alt+shift+plus" ] },
            { "command": "unbound", "keys": [ "alt+down" ] },
            { "command": "unbound", "keys": [ "alt+left" ] },
                { "command": "unbound", "keys": [ "alt+right" ] },
                { "command": "unbound", "keys": [ "alt+up" ] },
                { "command": "unbound", "keys": [ "alt+shift+down" ] },
                { "command": "unbound", "keys": [ "alt+shift+left" ] },
                { "command": "unbound", "keys": [ "alt+shift+right" ] },
                { "command": "unbound", "keys": [ "alt+shift+up" ] }

               ]

}
````

Er, your keybindings is completely outside of the root JSON object...

Er, your keybindings is completely outside of the root JSON object...

ermm... I didn't see any error messages! So, where should it be plugged in?

can confirm, after moving keys section into the root json object, shift+ins works. please close this issue

Was this page helpful?
0 / 5 - 0 ratings