yash-rs icon indicating copy to clipboard operation
yash-rs copied to clipboard

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

Open magicant opened this issue 1 year ago • 1 comments
trafficstars

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 avatar Jul 07 '24 15:07 magicant