Hi Martijn,

>>> We're at R56 now but nothing seems to have changed here. Status?
>>
>> It’s on the TODO.
>
> Here's another attempt at a patch. Note that this version checks for OFF(i) !=
> OF_CMDLINE to exclude immutable command line-only options (interactive, login,
> restricted, stdin).

I’ve experimentally (reads: may change, but as it isn’t a regression,
it can be included already anyway) solved it thusly:

The current state of the options, with some normalisation¹, is saved
away at shell startup. “set +o” then outputs a command² beginning with
“-o .reset” which restores it, followed by ±o as needed.

① FPOSIX, FSH, and those they clear as side effect (FBRACEEXPAND and
  UTFMODE) are zero’d, so these will be always output if set
② FPOSIX and FSH first, all others later, due to these side effects

Note that the “-o .reset” behaviour is not consistent across shell
invocations (interactive vs. mksh -c differ e.g. in interactive,
monitor, stdin, trackall), but, as the command following it will
only show differences from default, I think it’s good enough.

Please find this in R59b (which also fixes your regression) for
your pleasure (and finding new bugs…).

bye,
//mirabilos
-- 
Support mksh as /bin/sh and RoQA dash NOW!
‣ src:bash (389 (415) bugs: 1 RC, 264 (283) I&N, 124 (131) M&W, 0 F&P)
‣ src:dash (89 (104) bugs: 0 RC, 47 (51) I&N, 42 (53) M&W, 0 F&P)
‣ src:mksh (0 bugs: 0 RC, 0 I&N, 0 M&W, 0 F&P)
dash has two RC bugs they just closed because they don’t care about quality…

Reply via email to