MicrosoftDocs / terminal

Creative Commons Attribution 4.0 International
468 stars 170 forks source link

Update the PowerShell example to work around a PSReadLine issue #689

Closed yan12125 closed 10 months ago

yan12125 commented 12 months ago

PSReadLine cuts a substring since the last non-whitespace character in the prompt as the error prompt [1], which is displayed when there are syntax errors. As a result, when the prompt ends in $([char]27)\, as in the previous example, an unexpected backslash may appear.

See: https://github.com/PowerShell/PSReadLine/issues/3719

[1] https://github.com/PowerShell/PSReadLine/blob/v2.2.6/PSReadLine/ReadLine.cs#L819.


Closes https://github.com/MicrosoftDocs/terminal/issues/597

learn-build-service-prod[bot] commented 12 months ago

Learn Build status updates of commit d353759:

:white_check_mark: Validation status: passed

File Status Preview URL Details
TerminalDocs/tutorials/new-tab-same-directory.md :white_check_mark:Succeeded View

For more details, please refer to the build report.

For any questions, please:

yan12125 commented 12 months ago

Forgot to mention: this change is inspired by https://github.com/MicrosoftDocs/terminal/issues/597#issuecomment-1346749542

yan12125 commented 11 months ago

@zadjii-msft how do you think about this work-around?

(I pinged the assigner of #597. Sorry if I did something inappropriate)