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

Add a cross-platform "open" command to lib-core #25

Open
ezzatron opened this issue Jan 14, 2020 · 1 comment
Open

Add a cross-platform "open" command to lib-core #25

ezzatron opened this issue Jan 14, 2020 · 1 comment

Comments

@ezzatron
Copy link
Member

Linux uses xdg-open, macOS uses open. Targets that open URLs or files should work cross-platform.

@jmalloc
Copy link
Contributor

jmalloc commented Apr 8, 2020

FYI, Iggy tried to solve this on his own machine by aliasing open to xdg-open, but that doesn't work because as per https://stackoverflow.com/a/60022277 ...

Aliases are only supported in interactive shells by default.

Also, any code run in a subprocess (i.e. any command you run which is not a shell builtin) will be unable to change anything in the parent process (aliases, variables, etc). So you can't change the behavior of your current shell with make, or a script, or any other external command (except if you cause the shell to cooperate, for example by using a shell builtin which evaluates code printed by a subprocess - eval and source are two common ways to make the shell cooperate).

Not that an alias would form part of our solution, but I figured I'd post it here in case we experiment the same way and are equally baffled.

Edit:

[ignatius] also, xdg-open needs to be issued as xdg-open &>/dev/null

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

No branches or pull requests

2 participants