You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've developed a module (CmdFav) which inserts commands into the NEXT prompt. If the command is a multiline command the command string is internally build with StringBuilder.AppendLine(). StringBuilder is using Windows' carriage return + new line (`r`n) instead of just new line (`n). This causes PSConsoleReadLine::Insert to insert visible ^M characters (orange arrow in screenshot) and moves the cursor additional lines to low (red marker in screenshot).
The 'too low cursor' prevents the user to modify the code which is inserted into the prompt in the blank space. If I move the cursor into the blank space and (e.g.) press + the real code is shown, interrupted by the + char.
Expected behavior
No ^M visible
No blank lines
Inserted code should be editable in the right space
Actual behavior
Multiline text is postfixed with a ^M
After the inserted text additional blank lines are inserted, the cursor is not at the right spot
The effective inserted text is hidden in the blank lines and has to be edited there instead in the directly visible part
Prerequisites
Exception report
N/AScreenshot
Environment data
Steps to reproduce
I've developed a module (CmdFav) which inserts commands into the NEXT prompt. If the command is a multiline command the command string is internally build with StringBuilder.AppendLine(). StringBuilder is using Windows' carriage return + new line (`r`n) instead of just new line (`n). This causes PSConsoleReadLine::Insert to insert visible ^M characters (orange arrow in screenshot) and moves the cursor additional lines to low (red marker in screenshot).
Code to reproduce:
The 'too low cursor' prevents the user to modify the code which is inserted into the prompt in the blank space. If I move the cursor into the blank space and (e.g.) press
+the real code is shown, interrupted by the+char.Expected behavior
Actual behavior
^M