microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.35k stars 28.91k forks source link

Problem with WindowsTerminal/CMD - differences #207965

Closed ManPython closed 6 months ago

ManPython commented 6 months ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. I'm following the https://www.youtube.com/watch?v=RtY5FV5TrIU NES Development Environment

  2. Want compile demo from https://github.com/NesHacker/DevEnvironmentDemo

  3. Using https://sourceforge.net/projects/cc65/files/cc65-snapshot-win32.zip

  4. I have errors:

 *  The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cl65 "e:\roms\DevEnvironmentDemo-main\demo.s" " terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: cl65 "e:\roms\DevEnvironmentDemo-main\demo.s"  

cl65 : The term 'cl65' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ cl65 e:\roms\DevEnvironmentDemo-main\demo.s
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (cl65:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

 *  The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cl65 "e:\roms\DevEnvironmentDemo-main\demo.s" " terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

The reason for this due "Terminal" not like cmd but interactive. It's looks Windows problem around where Ineractive terminal is not this same as CMD.. Eg. when doing command in cmd: cl65.exe --verbose --target nes demo.s -o demo.nes its working

Also I noticed simial problem around CategoryInfo FullyQualifiedErrorId when using simple PIP in some cases, but not in CMD, by this powershell.exe doing problems around VSC. Not sure how to solve.. but maybe should be option how to force to CMD not powershell/WindowsTerminal

ManPython commented 6 months ago

Also trying experiments to omit Task build by "play" btn / debugger but no positive results.

        {
            "name": "ca65 NES",
            "type": "cl65",
            "request": "launch",
            "program":"${file}",
            "console": "integratedTerminal",
            "executable": "E:\\cc65-snapshot-win32\bin\\cl65",
            //"input": "demo.s",
            //params": "--verbose --target nes -o demo.nes",
            "args": ["--verbose --target nes -o demo.nes"],
            "sourcePath": "${workspaceFolder}/",
        },
ManPython commented 6 months ago

Regarding python and WindowsTerminal:

>setup
The Setup command may only be used inside a Describe block.
At C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\Describe.ps1:125 char:9
+         throw "The $CommandName command may only be used inside a Des ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (The Setup comma...Describe block.:String) [], RuntimeException
    + FullyQualifiedErrorId : The Setup command may only be used inside a Describe block.

By this must use CMD

kaligari commented 6 months ago

I think it's rather problem with configuring the task file in proper way. I had the same issue, found fast walkaround by setting command config direct in task.json like this:

"command": "C:\\cc65\\bin\\cl65 --verbose --target nes ${file} -o demo.nes",
ManPython commented 6 months ago

It's something like this:

activate
activate : The term 'activate' is not recognized as the name of a cmdlet, function, script file, or operable program. C
heck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ activate
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (activate:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Suggestion [3,General]: The command activate was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\activate". See "get-help about_Command_Precedence" for more details.

Then ok .\activate but if exist something like cl gcc msvc etc. giving problems.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "ca65 NES compiler XXX",
            "command": "C:\\cc65\\bin\\cl65 --verbose --target nes ${file} -o demo.nes",,

        },

I'm getting Cannot find a rom path in launch.json

vscodenpa commented 6 months ago

We closed this issue because it is a question about using VS Code rather than an issue or feature request. Please search for help on StackOverflow, where the community has already answered thousands of similar questions. You may find their guide on asking a new question helpful if your question has not already been asked. See also our issue reporting guidelines.

Happy Coding!

ManPython commented 6 months ago

It's problem around WindowsPowerShell use in case it's not this same as cmd around execute commands.

zaadevofc commented 4 months ago

use command prompt to fix this. cmd + R and type "cmd"

ManPython commented 4 months ago

Then better to disable new terminal from VSC if not spending requirements