mrsh icon indicating copy to clipboard operation
mrsh copied to clipboard

mrsh does not set PS1 prompt

Open cole-h opened this issue 5 years ago • 2 comments

Although it displays $ (or # when root), it never actually sets the PS1 prompt to this.

Relevant code: https://github.com/emersion/mrsh/blob/60ef497e4d83320be5c32505b244f0f0318e4879/shell/entry.c#L60

The other POSIX shells I tested, bash --posix and dash, both set the PS1, even if it is as simple as $ in dash's case.

cole-h avatar Mar 21 '20 01:03 cole-h

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.

emersion avatar Mar 21 '20 18:03 emersion

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.

cole-h avatar Mar 21 '20 18:03 cole-h