Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pewscorner opened this issue May 6, 2021 · 3 comments
Assignees
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug investigating We are looking into the cause of the issue

Comments

@pewscorner
Copy link

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 (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

None

@pewscorner pewscorner added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels May 6, 2021
@pewscorner
Copy link
Author

Might this be a consequence of vscode issue 123188?

@karthiknadig karthiknadig assigned karrtikr and unassigned kimadeline May 10, 2021
@karthiknadig karthiknadig added area-terminal and removed triage-needed Needs assignment to the proper sub-team labels May 10, 2021
@karrtikr
Copy link

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

@karrtikr karrtikr added investigating We are looking into the cause of the issue and removed triage labels May 11, 2021
@karrtikr
Copy link

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug investigating We are looking into the cause of the issue
Projects
None yet
Development

No branches or pull requests

4 participants