Skip to content

Latest VS Code terminal settings for Windows Command Prompt cause "Start REPL" to fail #16169

Closed

Description

@pewscorner

Environment data

  • VS Code version: 1.56.0
  • Extension version (available under the Extensions sidebar): 2021.4.765268190
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Value of the python.languageServer setting: Pylance

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

The REPL starts.

Actual behaviour

The REPL fails to start because PowerShell syntax is used ("& D:/Python/Python39/python.exe"), and Command Prompt doesn't understand this (error message: "& was unexpected at this time.").

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Use VS Code's new terminal settings to make Command Prompt the default terminal:
    "terminal.integrated.profiles.windows": {
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
    },
    "terminal.integrated.defaultProfile.windows": "Command Prompt",
  1. Use the "Python: Start REPL" command (or the "Python: Run Selection/Line In Terminal" command) to start python in a terminal.

The problem does not occur if PowerShell is selected as the default terminal, or if the now deprecated terminal setting is used to select Command Prompt ("terminal.integrated.shell.windows": "${env:windir}\\Sysnative\\cmd.exe").

Logs

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

None

Activity

  1. added
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on May 6, 2021
  2. pewscorner commented on May 7, 2021

    @pewscorner
    Author

    Might this be a consequence of vscode issue 123188?

  3. karrtikr commented on May 10, 2021

    @karrtikr

    Thanks for the bug report! We just wanted to quickly acknowledge we received it and we will triage this as soon as we can.

  4. karrtikr commented on May 11, 2021

    @karrtikr

    Closing as dup of #16175. Please use the old setting as a workaround until this fixed. #16175 (comment)

  5. locked as resolved and limited conversation to collaborators on Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-terminalbugIssue identified by VS Code Team member as probable buginvestigatingWe are looking into the cause of the issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions