PSReadLine
PSReadLine copied to clipboard
Add Continuation Prompt Counter
trafficstars
Summary of the new feature / enhancement
For example automatic variable:
On screenshot $ps2count as a concept of how to use this variable. Nowadays increment of variables ( $ps2count++ ) is not working in Continuation Prompt.
PS. I very often use script-blocks directly in the console.
Proposed technical implementation details (optional)
No response
You'll have a better chance of convincing others that this proposal is worth implementing if you explain why having line numbers in interactive multiline input is useful.
Note that currently only a static string seems to be supported.
It is easier to find an error in a script block. Especially when there are more than 10 lines.
PS > & { # 01
$a = "a" # 02
$b = "b" # 03
1/0 # 04
$c = "c" # 05
} # 06
RuntimeException:
Line |
4 | 1/0
| ~~~
| Attempted to divide by zero.