Ticket #4634 (new enhancement)

Opened 7 hours ago

Clean up subshell precmd and PS1 handling

Reported by: zaytsev Owned by:
Priority: major Milestone: 4.8.34
Component: mc-core Version: master
Keywords: Cc: ossi, d3m3t3r
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Follow-up for #3748:

We want to remove our PS1 / prompt fallbacks for all shells and cleanup fallback precmd handling:

        "_mc_precmd() { "
        "  pwd>&%d; "
        "  kill -STOP $$; "
        "}; "
        "_MC_PRECMD=_mc_precmd; "
        "PS1='$($_MC_PRECMD)'\"${PS1:-'$PWD $ '}\"\n";

to actually answer the question whether PS1 can be unset in the first place: probably not. i mean, it can if you manually unset it, but dash actually shows no prompt at all in this case. so arguably, providing even a minimal PS1 fallback is unnecessary.

It's definitely quite unlikely an interactive shell not setting PS1. The user would need to mess up something. IMO, the default PS1 could be removed from every 'precmd' code if we check all shells cope with empty PS1 reasonably. For bash, you can test it by adding "unset PS1" into .bashrc. It seems to work fine.

Note: See TracTickets for help on using tickets.