Subprocess mode
This would enable one to simply kill the current shell to revert state.
Due to lack of any (or at least consistent) support for running shell code on startup of a shell (without screwing with the normal (bashrc, etc) loading sequence, this will likely have to rely on an environment variable.
Potential sequence of events:
- start subprocess with SAUCE_SUBPROCESS=1 env var (automatically +1 from previous/missing value)
- normal
sauce shell initbashrc/zshrc/etc loading behavior should causesauceto be invoked. -
sauce shell initinspects that env var and automatically emits the autoload-hook shell stuff and force-overrides the autoload flag (once) - that, in turn, causes
sauceto execute once, on shell startup
In this way, sauce shell can essentially just start a subprocess in a particular way and the rest should "just work"
sauce config subshell=false/true (default false)
Given subshell=true, sauce shell init would emit a --subprocess flag into the shell invocation (to avoid forcing loading config on a vanilla sauce command.
--subprocess flag would then cause sauce to create a subprocess into the above subprocess workflow would execute.