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 setting bios.shell_path #1795

Open
wants to merge 3 commits into
base: mc-1.20.x
Choose a base branch
from

Conversation

hugeblank
Copy link
Member

Allows the user to directly set the path the bios uses to launch the shell. Setting bios.shell_path takes precedent over bios.use_multishell. Essentially a custom shell may choose to implement shell and multishell APIs, independent of whether use_multishell is set. This is loosely reflected in the description of the setting. Also some additional status checking has been implemented to allow for shell errors to be easily read before computer shutdown.

My justification for adding this is that while unbios exists, it is the logical extreme of what I imagine most players want. This PR is the spirit of unbios in a way that makes sense for CC, that advanced players can take advantage of (if I'm not mistaken mbs could benefit from this too, no?) Also servers presumably would ever so slightly benefit from computers that don't need a whole shell having the ability to start without one.

Allow the user to directly set the path the bios uses for the shell.

Has some additional status checking to allow for shell errors to be read before computer shutdown.
I learned how to lintLua!
@SquidDev
Copy link
Member

This was previously discussed in #710 and #911, and it's still not clear to me if this is actually useful. I understand the instinctual desire for this, but I don't actually think it ends up solving any practical problem.

@hugeblank
Copy link
Member Author

The utility for me is that I don't have to deal with my own shell (or programs that don't require a shell) being layered atop an existing shell. It just feels like an extra step that should have the ability to be removed, especially when it's dead simple to implement, does not break compatibility, and is entirely up to the user to take advantage of.

@Wojbie
Copy link
Contributor

Wojbie commented Apr 19, 2024

How does the dead shell impacts anything? Assuming multishell is off and you called shell.exit() in startup code that then initiated your shell it no longer does anything and will exit once your code exits.

EDIT: I guess it is there in call stack but does that really impact anything ?

@hugeblank
Copy link
Member Author

hugeblank commented Apr 19, 2024

Assuming multishell is off and you called shell.exit() in startup code that then initiated your shell it no longer does anything and will exit once your code exits.

Startup programs wouldn't even be ran, and the shell API would not exist. Those are both things the shell does. Basically any shell.<...> setting would become something the user may (or may not) implement in their custom shell.

EDIT:
#1796 posed an interesting problem regarding startup files that I spent far too long thinking up a couple solutions for. Like I mention in this comment before the edit, startup programs wouldn't even be ran, and as such players wouldn't even be faced with having to deal with the limitations and quirks of the vanilla shell. This is a benefit to the option of having a clean slate for a custom shell.

Extracts os.run into an internal launch function so we can extract shell errors and correctly display them on the native terminal.
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

Successfully merging this pull request may close these issues.

None yet

3 participants