SeeLog / commando

Commando: Simple and powerful command executor extension for VSCode.
MIT License
3 stars 0 forks source link

GitBash commands error #26

Open BachiMjavanadze opened 1 year ago

BachiMjavanadze commented 1 year ago

Looks like your extension uses only windows cmd terminal. Please make possible to use Git Bash terminal too because I have an error when I try to use simple commands written for Git Bash. i.e.:

"cmd": "echo 'Goodbye World' && echo 'Hello World'",

(It does not like &&).

I suggest add extra property in the settings:

"terminal": "cmd / powershell / Git Bash",

SeeLog commented 1 year ago

Thanks for your report.

Could you try commando.shell option or shell option for each command? This extension is not for only Windows, but allow to set what you want to use shell in Linux/Mac OS. Maybe also you can use these options in Windows.

If you cannot use your specified shell with short name like bash, please set full path for Git Bash.

BachiMjavanadze commented 1 year ago

@SeeLog OUTPUT does not works correctly:

image

but for Terminal - works:

image

P.S. "shell" or "commando.shell" settings has no effect, it depends only on VSCode setting:

"terminal.integrated.defaultProfile.windows": "Git Bash / Powershell / Command Prompt",

BachiMjavanadze commented 1 year ago

@SeeLog I suggested 3 features. Please review them

SeeLog commented 1 year ago

@BachiMjavanadze Is the shell name of "bach" is correct? I have never heard "bach".

In my case, this settings works fine on Windows and Git Bash.

{
    "commando.commands": [
        {
            "cmd": "echo foo && echo bar",
            "name": "check",
            "shell": "bash"
        }
    ]
}

Also shell option works fine, I think. My terminal.integrated.defaultProfile.windows is PowerShell, however the command below is working. If shell option is not working, it runs on PowerShell and then, it should cause error because && is not allowed in Powershell.

Please check your environment or configuration of this extension.

BachiMjavanadze commented 1 year ago

@SeeLog I'm on Windows 11. It does not work. Not for Git Bash:

image

not for Powershell:

image

SeeLog commented 1 year ago

Can you run bash in your PowerShell or CMD? If you can't, maybe the PATH is not appropriate. In this case, set the shell option to fullpass/to/your/shell or set an appropriate PATH.

I cannot reproduce this issue on Windows10/11, so maybe something is wrong with your environment. https://github.com/nodejs/help/issues/4095 may help you, because of same error code.