Open cole-h opened 4 years ago
The POSIX spec just says:
The default value shall be "$ ".
It's not clear to me whether this is the value set on startup, or whether this is the value used if unset.
dash
appears to just set it (as the PS1
) on startup. If it's unset, it displays nothing.
I would personally read that as setting the initial PS1
, but there is no one way to interpret it. It's up to you (obviously), but it might come as a shock to any mrsh
+ zoxide
users when their prompt disappears after sourcing the init script.
Although it displays
$
(or#
when root), it never actually sets thePS1
prompt to this.Relevant code: https://github.com/emersion/mrsh/blob/60ef497e4d83320be5c32505b244f0f0318e4879/shell/entry.c#L60
The other POSIX shells I tested,
bash --posix
anddash
, both set the PS1, even if it is as simple as$
indash
's case.