magicant / yash-rs

Reimplementation of yash, an extended POSIX shell
63 stars 3 forks source link

Expand `$LINENO` to a correct value in the prompt string #382

Open magicant opened 1 month ago

magicant commented 1 month ago

In the current implementation, the $LINENO variable contained in the prompt string ($PS1 and $PS2) always expands to 1. This is because the expansion of the $LINENO parameter occurs in the first line of the prompt string variable value, which is parsed as text.

A more intuitive behavior would be to expand $LINENO to the line number in the current lexer context, but the current architecture does not allow this because we now create a separate lexer to parse the text.

magicant commented 1 month ago

I won't be addressing this issue anytime soon.