PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Add Continuation Prompt Counter

Open 237dmitry opened this issue 2 years ago • 2 comments
trafficstars

Summary of the new feature / enhancement

For example automatic variable:

ArcoLinux_2023-05-13_21-53-00

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

237dmitry avatar May 13 '23 07:05 237dmitry

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.

mklement0 avatar May 14 '23 16:05 mklement0

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.

237dmitry avatar May 14 '23 17:05 237dmitry