vscode-edit-with-shell icon indicating copy to clipboard operation
vscode-edit-with-shell copied to clipboard

Error message is unnecessarily escaped

Open kfir-drivenets opened this issue 7 years ago • 3 comments

I try to run a local script awesome_script.py param1 param2 the error I got was awesome\_script.py command not found. Note that added \ to the command name. When I run the same script directly with my shell, e.g /bin/sh -c awesome_script.py param1 param2 everything works like a charm..

kfir-drivenets avatar Oct 16 '18 18:10 kfir-drivenets

Turns out the issue was locally on my end, needed to add -i flag to shellArgs and all worked.

kfir-drivenets avatar Oct 16 '18 18:10 kfir-drivenets

Hi @kfir-drivenets , thanks for updating us with the conclusion. I was away on holiday.

I try to run a local script awesome_script.py param1 param2 the error I got was awesome\_script.py command not found. Note that added \ to the command name.

The \ seems to be coming from this text escaping rule, which is only apply to error messages. So I guess what happened was, the shell did look for awesome_script.py but couldn't find one and generated an error message, awesome_script.py command not found, which then the extension added \ just before it showed you the message.

The error message should have been awesome_script.py command not found. Looking at this test case about the formatting, I shouldn't escape single _ but double underscores __.

ryu1kn avatar Oct 20 '18 06:10 ryu1kn

I repurpose this issue 😉 I've updated the issue title.

ryu1kn avatar Oct 20 '18 06:10 ryu1kn