HomeFreeBSD

sh: Implement simple parameter expansion in PS1 and PS2

Description

sh: Implement simple parameter expansion in PS1 and PS2

This change follows a localized approach within getprompt() and avoids
full parser reentry. While this means we don't support advanced
expansions like ${parameter#pattern}, it provides POSIX-compliant basic
parameter expansion without the complexity of making the parser
reentrant. This is sufficient for the vast majority of use cases.

PR: 46441

Details

Provenance
Matthew Phillips <matthew@matthewphillips.info>Authored on Oct 12 2025, 7:27 PM
jillesCommitted on Nov 7 2025, 10:35 PM
Parents
rG9b7d2cee03e5: safe(4): add gone_in 16.0
Branches
Unknown
Tags
Unknown

Event Timeline