yhirose / vscode-filtertext

Filter Text extension for VS Code
MIT License
30 stars 9 forks source link

Allow to specify the shell #7

Closed antoniomacri closed 6 years ago

antoniomacri commented 7 years ago

I'm on a Windows system.

When I type "grep X" the message "Invalid command is entered" appears, so I assume the plugin uses the Windows Command prompt. Am I right?

I also have a bash on my system and I would like to use the bash instead. Can you make this configurable?

Thanks, Antonio

yhirose commented 7 years ago

@antoniomacri, thanks for the request.

The extension uses the Node.js API child_process.spawn(command[, args][, options]) to kick a command from the default shell (process.env.ComSpec on Windows). But I found the nice option in the API:

shell <boolean> | <string> If true, runs command inside of a shell. Uses '/bin/sh' on UNIX, and process.env.ComSpec on Windows. A different shell can be specified as a string. See Shell Requirements and Default Windows Shell. Defaults to false (no shell).

I'll give it a try to implement the feature.

jpotterm commented 6 years ago

@antoniomacri Did you try specifying the full path to grep (e.g. /usr/bin/grep)? I wouldn't expect running grep to require any shell at all; it's just an executable.

yhirose commented 6 years ago

Fixed by #10.