vscode-shell-command icon indicating copy to clipboard operation
vscode-shell-command copied to clipboard

Running the contributed command 'shellCommand.execute' failed

Open rafal19921989 opened this issue 3 years ago • 10 comments

When I use the example of this extension I always have a problem: "Running the contributed command 'shellCommand.execute' failed"

rafal19921989 avatar Oct 28 '21 08:10 rafal19921989

I'm sorry. I'm having very few time at the moment to troubleshoot this.

@hwmaier @Penguinang could you check if the changes of one of you caused this?

augustocdias avatar Oct 28 '21 12:10 augustocdias

@rafalszuta It means that your shell failed to execute. Can you execute it in terminal with an exit code of zero

Penguinang avatar Oct 28 '21 13:10 Penguinang

By the way, is your OS linux, windows, or mac? On linux and macos, the default shell is sh, NOT bash or your system's default shell. Can you try your shell command in the /bin/sh shell?

Penguinang avatar Oct 28 '21 14:10 Penguinang

Hi All! I'm using Windows 10 I'm trying to use your extension to list all files in the given directory

This is my tasks.json file: { "version": "2.0.0", "tasks": [ { "label": "Nested input", "command": "echo ${input:pickTest}", "type": "shell", "problemMatcher": [], }, "inputs": [ { "id": "pickTest", "type": "command", "command": "shellCommand.execute", "args": { "command": "ls" } }, ] }

I see that you added an info: command: the system command to be executed (must be in PATH)

I checked and I have the C:\Windows\SysWOW64\WindowsPowerShell\v1.0 within PATH

rafal19921989 avatar Oct 29 '21 13:10 rafal19921989

does dir command work? @rafalszuta

Penguinang avatar Oct 29 '21 13:10 Penguinang

Yes

pt., 29 paź 2021, 15:37 użytkownik PengBo Yang @.***> napisał:

does dir command work? @rafalszuta https://github.com/rafalszuta

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/augustocdias/vscode-shell-command/issues/32#issuecomment-954751070, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRFGW7VXFYP66BEEQQQUXLUJKPQ5ANCNFSM5G4HSZ2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

rafal19921989 avatar Oct 29 '21 13:10 rafal19921989

I'm not sure, but I suspect the shell actually being used might be cmd.exe instead of powershell. Does ls command fails to work in cmd.exe?

Penguinang avatar Oct 29 '21 14:10 Penguinang

For cmd.exe is dir command instead ls. So how can I use powershel as the used console in VsCode tasks.json?

pt., 29 paź 2021, 16:27 użytkownik PengBo Yang @.***> napisał:

I'm not sure, but I suspect the shell actually being used might be cmd.exe instead of powershell. Does ls command fails to work in cmd.exe?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/augustocdias/vscode-shell-command/issues/32#issuecomment-954790011, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRFGW4VQMRRX2HLWUVZIYDUJKVORANCNFSM5G4HSZ2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

rafal19921989 avatar Oct 29 '21 15:10 rafal19921989

At the moment it is not possible. It was implemented to use the default from vscode settings but we had to revert because of #9

since I don’t have a windows machine I can’t test and fix it, I can't do much.

augustocdias avatar Oct 29 '21 20:10 augustocdias

@rafalszuta I think maybe you can specify powershell in "command" variable, like

"command": "powershell -Command \"echo 1\";"

Penguinang avatar Oct 30 '21 05:10 Penguinang

Closing due to inactivity. Feel free to reopen if it's still an issue for you.

MarcelRobitaille avatar Jan 24 '24 22:01 MarcelRobitaille