Skip to content

Commit

Permalink
Only use pwsh paste on PowerShell 6+
Browse files Browse the repository at this point in the history
Fixes #95169
  • Loading branch information
Tyriar committed Apr 14, 2020
1 parent bcded08 commit 4e0b249
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -153,7 +153,7 @@ if (BrowserFeatures.clipboard.readText) {
// shell, this gets handled by PSReadLine which properly handles multi-line pastes
if (platform.isWindows) {
registerSendSequenceKeybinding(String.fromCharCode('V'.charCodeAt(0) - 64), { // ctrl+v
when: ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_FOCUS, ContextKeyExpr.equals(KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE_KEY, WindowsShellType.PowerShell)),
when: ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_FOCUS, ContextKeyExpr.equals(KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE_KEY, WindowsShellType.Pwsh)),
primary: KeyMod.CtrlCmd | KeyCode.KEY_V
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/contrib/terminal/browser/terminal.ts
Expand Up @@ -188,7 +188,8 @@ export interface ISearchOptions {

export enum WindowsShellType {
CommandPrompt = 'cmd',
PowerShell = 'pwsh',
PowerShell = 'powershell',
Pwsh = 'pwsh',
Wsl = 'wsl',
GitBash = 'gitbash'
}
Expand Down
Expand Up @@ -151,8 +151,9 @@ export class WindowsShellHelper extends Disposable implements IWindowsShellHelpe
case 'cmd.exe':
return WindowsShellType.CommandPrompt;
case 'powershell.exe':
case 'pwsh.exe':
return WindowsShellType.PowerShell;
case 'pwsh.exe':
return WindowsShellType.Pwsh;
case 'bash.exe':
return WindowsShellType.GitBash;
case 'wsl.exe':
Expand Down

0 comments on commit 4e0b249

Please sign in to comment.