On 11/01/2021 16:45, Austin Group Bug Tracker via austin-group-l at The
Open Group wrote:
shall be set to the default action.</li><li>If the shell is interactive,
the subshell shall behave as a non-interactive shell in all respects
except:<ul><li>The expansion of the special parameter '-' and the output of
<tt>set -o</tt> and <tt>set +o</tt> shall continue to indicate that it is
interactive.</li><li>The <tt>set -n</tt> option may be
ignored.</li></ul></ul></blockquote>
The output of set -o and set +o need not indicate whether the shell is
interactive. Most (not all) shells include it in set -o, most (not all)
shells exclude it from set +o. Those shells that do not indicate that
the shell is interactive cannot continue to indicate so.
All shells that I know of do include i in $- when the shell is
interactive, but pdksh and derivatives (posh, mksh) remove it from $- in
subshells. There does not seem to be a good reason to require a change
to these shells so that an effectively non-interactive subshell starts
to pretend that it is interactive.
Cheers,
Harald van Dijk