prefix-dev / shell

The ultimate cross-platform, bash-like shell
MIT License
35 stars 5 forks source link

Implement `open` #109

Open certik opened 1 week ago

certik commented 1 week ago

On macOS the open command uses the system-registered GUI program to open a given file. On Windows in WSL one can use explorer some.xls. On Linux there is also a way to do this.

So we can implement this support on all platforms and just call it open.

wolfv commented 6 days ago

Good idea! Although that starts to venture into "superset" territory.

certik commented 6 days ago

The open command could be a conda package. Then we are in the subset category again. :)

Alternatively we can only support it in interactive mode, I suspect I never used "open" in a script on macOS, only in interactive mode.

wolfv commented 6 days ago

On Linux it's usually xdg-open ... which is quite unintuitive.

wolfv commented 6 days ago

Ok, I have some more thoughts on this now.

Maybe we should create a "coreutils-ext" that contains some additional utilities such as:

That way, they could also be installed separately by users of bash/zsh and don't hinder compatibility concerns.

prsabahrami commented 6 days ago

Ok, I have some more thoughts on this now.

Maybe we should create a "coreutils-ext" that contains some additional utilities such as:

  • dl: download a file to stdio

  • open: open a file (open/xdg-open/explorer.exe replacement)

  • ...

That way, they could also be installed separately by users of bash/zsh and don't hinder compatibility concerns.

I like this =))

certik commented 6 days ago

Yes, that's the way to do it. Anything we do must work in regular Bash and Zsh on Linux / macOS. Most of these things can be implemented as standalone programs.

certik commented 8 hours ago

Maybe we should create a "coreutils-ext" that contains some additional utilities such as:

I made this https://github.com/prefix-dev/shell/issues/141.