Skip to content

Python: Create Terminal getting stuck in powershell #2410

@mattmj

Description

@mattmj

Environment data

  • VS Code version: 1.26.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Windows 10 Home 1803
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.5, Miniconda 3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A (base conda)
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

Python: Create Terminal, or Run Python file in Terminal, or Run Selection/Line in Python Terminal all open powershell terminal execute "& cmd /k 'activate base & powershell", and end on a powershell input line. Any further input, or attempt at reopening terminal either runs through powershell and raises a variety of errors (as it should) or opens another instance of a terminal with identical results.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:*working directory*> & cmd /k "activate base & powershell"
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:*working directory*>

Expected behavior

Next command would be my python.pythonpath followed by the activation of a python terminal.

Steps to reproduce:

  1. Command Prompt
  2. Python: Create Terminal -or- Right-Click: Run Python file in terminal -or- Right-Click: Run selection/line in Python terminal (and all associated keybindings)

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

[Info  - 2:56:01 PM] Reloading modules...

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

index.js:5 [uncaught exception]: Error: Pty seems to have been killed already
onError @ index.js:5
index.js:5 Error: Pty seems to have been killed already
    at WindowsPtyAgent.kill (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsPtyAgent.js:83:13)
    at WindowsTerminal.<anonymous> (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsTerminal.js:144:26)
    at WindowsTerminal._defer (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsTerminal.js:155:24)
    at WindowsTerminal.kill (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsTerminal.js:139:14)
    at file:///C:/Program Files/VSCode/resources/app/out/vs/workbench/workbench.main.js:2760:231
onError @ index.js:5
C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsPtyAgent.js:83 Uncaught Error: Pty seems to have been killed already
    at WindowsPtyAgent.kill (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsPtyAgent.js:83:13)
    at WindowsTerminal.<anonymous> (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsTerminal.js:144:26)
    at WindowsTerminal._defer (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsTerminal.js:155:24)
    at WindowsTerminal.kill (C:\Program Files\VSCode\resources\app\node_modules.asar\node-pty\lib\windowsTerminal.js:139:14)
    at file:///C:/Program Files/VSCode/resources/app/out/vs/workbench/workbench.main.js:2760:231

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-terminalbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions