-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRLF is printing ^M #245
Comments
How do I reproduce this issue? |
Jason, this is the PowerShell Studio console, but it should repro on any host that interprets \n as \r\n, per the Windows standard.
|
I think PSReadline is doing the correct thing here, and the PowerShell Studio host is incorrectly sending \r as a keystroke. For comparison, conhost does not send that key when pasting via right click. Similarly, if you paste via Ctrl+v, PSReadline does the right thing here. That said, it looks like PowerShell Studio is redirecting standard input. That causes lots of problems because there is no terminal emulation support, so many key binding don't work. When PSReadline sees redirected input, I think I'll be forced to deal with emulating what conhost does in terms of ignoring \r. If I'm wrong about how PowerShell Studio is implemented, then I think PowerShell Studio needs to be changed because it would be acting more like conhost in that case. |
Thanks for the quick reply, Jason. I'll pass on the info. |
I just checked and we don't redirect anything. We use standard Microsoft APIs to attach a console to a Windows host (AttachConsole) and write to the console (WriteConsole). WriteConsole requires CRLF, so we use it. It seems to me that PSReadline should support this. |
Closing in favor of #579 which covers all of the known issues with right-click paste. |
Windows standard line endings are CRLF. In our PowerShell host, we make sure each \n is converted to a \r\n to conform to the standard, but PSReadLine expects only \n. When we pass \r\n, it prints ^M.
PSReadLine should conform to the Windows standard. Is it possible to make this change?
The text was updated successfully, but these errors were encountered: