Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About runInShell #113

Open
busslina opened this issue Dec 25, 2024 · 5 comments
Open

About runInShell #113

busslina opened this issue Dec 25, 2024 · 5 comments

Comments

@busslina
Copy link

Hi, I wanted to know what runInShell parameter means.

Thanks.

@alextekartik
Copy link
Contributor

process_run uses Proces io that has this parameter:
https://api.dart.dev/dart-io/Process/start.html

According to the doc:

If runInShell is true, the process will be spawned through a system shell. On Linux and OS X, /bin/sh is used, while %WINDIR%\system32\cmd.exe is used on Windows.

@busslina
Copy link
Author

busslina commented Dec 30, 2024

Thanks very much. It's a bit messy to have a Shell which defaults to false (true on Windows) runInShell. So if I understood correctly, when false, it's executed on the dart process.

@alextekartik
Copy link
Contributor

Indeed it is kind of misnamed but i don't think it is safe to change the behavior now. I have not played much with this flag so I guess most of the times it is not needed. If someone has a good example that could explain cases when it is needed, I would gladly add it to the documentation.

@busslina
Copy link
Author

busslina commented Jan 23, 2025

Image

Make sense. Now, an improvement would be to be able to select what shell. If sh is the default would be great to be able to use bash instead.

Edit: But this is not in the scope of this package I suppose.

@alextekartik
Copy link
Contributor

Thanks for digging the proper doc @busslina
Indeed I added this parameter since it was present in the io version but I don't do much about it and my fear is that we cannot change the behavior. An alternative is to set it to false and use the preferred system shell.

Example on linux:

await run('bash -c uname');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants