question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VS Code Keyboard Shortcut for "Paste" Command Not Used in PowerShell Terminal Window

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

When I press CTRL+V in the “PowerShell Extension” Terminal, the text in the Windows Clipboard is not pasted. Instead, nothing happens.

The VS Code Keyboard Shortcuts window shows that the Paste command and Terminal: Paste into Active Terminal command are mapped to CTRL+V, which is what I want because I remember doing something to the Terminal to make it use CTRL+V.

However, there is an entry at the bottom that kicks in when the terminalShellType is “pwsh”. I assume that “pwsh” refers to the “PowerShell Extension” terminal although “pwsh” does not appear in the Terminal window.

PowerShell Version

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.6
PSEdition                      Core
GitCommitId                    7.2.6
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

> code --version
1.72.2
d045a5eda657f4d7b676dedbfa7aab8207f8a075
x64

Extension Version

> code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2022.8.5

Steps to Reproduce

  1. Start VS Code with the PowerShell Extension installed and the Terminal’s Paste command mapped to CTRL+V.
  2. Copy a word from a web page (e.g. “Steps”).
  3. Click in the Terminal (PowerShell Extension).
  4. Press CTRL+V

Visuals

VS Code Keyboard Shortcuts Window

Logs

After following the instructions to set the log level to Diagnostic, I reproduced the problem and closed VS Code. Then, when I looked at C:\Users\zchoy\.vscode\extensions\ms-vscode.powershell-2022.8.5, I could not find a folder named logs.

The Settings window did not have a reference to anything called a “settings file”. I also tried typing “settings file” into the textbox that appears in VS Code after pressing CTRL+P. VS Code said “No matching results”.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
msftbot[bot]commented, Oct 29, 2022

This issue was closed automatically as repro info was indicated as needed, but there has been no activity in over a week. Please feel free to reopen with any available information!

0reactions
andschwacommented, Nov 30, 2022

Well, this is weird. I can reproduce this still too, but Ctrl-Shift-V works. They’re both default keybindings and bound to the same thing:

{ "key": "ctrl+shift+v",          "command": "workbench.action.terminal.paste",
                                     "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" },
{ "key": "ctrl+v",                "command": "workbench.action.terminal.paste",
                                     "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrated Terminal in Visual Studio Code
Use the Ctrl+Shift+` keyboard shortcut to create a new terminal. Use the View > Terminal or Terminal > New Terminal menu commands. From...
Read more >
In Visual Studio Code Ctrl+V is not working
Go to File->Preferences->Keyboard shortcuts. Find the editor.action.clipboardPasteAction and double click it, then type Ctrl+V. Share.
Read more >
Copy and paste in Windows PowerShell
To paste into the PowerShell window, right click. keyboard ... Note: In current versions of Windows 10, Ctrl + C , and Ctrl...
Read more >
Support copy and paste via keyboard on integrated terminal
Always paste ctrl + v (after process ended); Select text with mouse; Select text with keyboard shift + ← / →. You can...
Read more >
Keyboard Shortcuts for the Windows PowerShell ISE
Use the following keyboard shortcuts to perform actions in Windows PowerShell Integrated ... Paste, CTRL + V, Script Pane, Command Pane.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found