Debug task runner: check for powershell.exe _and_ pwsh.exe to determine if "&&" can be used to chain commands
See original GitHub issueEnvironment data
- VS Code version: 1.25.1
- Extension version (available under the Extensions sidebar): 2018.7.1
- OS and version: Windows 10 1803, x64
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.5 x64
- Type of virtual environment used: N/A
- Relevant/affected Python packages and their versions: N/A
Actual behavior
Launching debug task uses “&&” to chain commands when shell set to “pwsh.exe”.
Expected behavior
Powershell only likes “;” to chain commands.
Steps to reproduce:
- In some Python project, configure this task:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Test script",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/test.py",
},
]
}
- Install Powershell 6.0.x
- Set
"terminal.integrated.shell.windows": "pwsh.exe"
in configuration (PowerShell 6.0.x uses it to differentiate itself from the Windows Powershell) - “Start Debugging” with that task
- Set shell to “powershell.exe” and repeat.
Logs
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
> cd c:\[...]\fontParts && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && python c:\[...]\.vscode\extensions\ms-python.python-2018.7.1\pythonFiles\PythonTools\visualstudio_py_launcher.py c:\[...]\fontParts
61019 34806ad9-833a-4524-8cd6-18ca4aa74f14 RedirectOutput,RedirectOutput C:\[...]\fontParts/Lib/fontParts/fontShell/test.py "
At line:1 char:59
+ cd c:\[...]\fontParts && cmd /C " ...
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Debug task runner: check for powershell.exe _and_ pwsh.exe ...
Debug task runner : check for powershell.exe _and_ pwsh.exe to determine if "&&" can be used to chain commands #55852 ; bug Issue...
Read more >about Pwsh - PowerShell | Microsoft Learn
Explains how to use the `pwsh` command-line interface. Displays the command-line parameters and describes the syntax.
Read more >PowerShell@2 - PowerShell v2 task | Microsoft Learn
Use this task to run a PowerShell script on Linux, macOS, or Windows. ... If the value is set to true , the...
Read more >Start-Process (Microsoft.PowerShell.Management)
This example starts a process that uses the Sort.exe file in the current folder. The command uses all the default values, including the...
Read more >Get-Process (Microsoft.PowerShell.Management)
This command gets all processes that have a working set greater than 20 MB. It uses the Get-Process cmdlet to get all running...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we can close this issue, as its an upstream VS Code issue. Also the issue has been fixed in VSC.
I’ll quickly mention that under PowerShell Core 6.0.3 I got
;
used as my separator: