SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.67k stars 3.19k forks source link

Shell: Move towards POSIX compliance #6847

Open awesomekling opened 3 years ago

awesomekling commented 3 years ago

Coming up with a custom shell language was fun, but ultimately does not solve any real problems for us.

Having a POSIX compliant shell would allow us to, well, run POSIX shell scripts. (This currently requires installing a 3rd party shell.)

I'm not sure what the best way to approach this work is, but let's have an issue open about it.

alimpfard commented 3 years ago

Since we're apparently back in the design phase, I'm going to list the things I'd like the shell to have/support, in order of importance

In REPL mode:

In scripting mode:

Others + niceties:

That's all, best of luck to whomever decides to work on this : )

xeriab commented 3 years ago

I started to implement some missing built-ins, and I will stick myself working on shell for now and I will do what I can gradually =)

asynts commented 3 years ago

Would it be unreasonable to maintain two shells, the current one and one that provides /bin/sh for compatibility?

(Currently, I am just passively watching the project, just adding my two cents.)

bugaevc commented 3 years ago

As one of the people responsible for the decision to make our beloved Shell non-POSIX, I still believe it was the right thing to do. A POSIX shell is needed to run third-party scripts, I acknowledge that; but that doesn't mean our Shell has to be broken because of it.

That being said, perhaps either adding a POSIX-compatible mode to our Shell (like the one GNU Bash enables if invoked as sh), or implementing a separate, minimal POSIX shell (like Debian going with /bin/sh -> dash) would be a good idea. This would let us run third-party scripts without sacrificing everything we love about the Shell.