Skip to content

Disable PSReadline on Unix when stdin or stdout is redirected - #648

Merged
Jason Shirk (lzybkr) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:fix2
Mar 20, 2018
Merged

Jason Shirk (lzybkr) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:fix2

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

Fix #625

System.Console doesn't handle redirected input on Unix Platforms. It matches the behavior on Windows by throwing an InvalidOperationException. Therefore, if either stdin or stdout is redirected, PSReadLine doesn't really work on Unix. So we throw NotSupportedException in such cases and let PowerShell call Console.ReadLine or do whatever else it decides to do.

@daxian-dbw

Copy link
Copy Markdown
Member Author

I have verified that the console stdin redirection tests in PowerShell passed with this change.

@lzybkr
Jason Shirk (lzybkr) merged commit 62cf9f8 into PowerShell:master Mar 20, 2018
@daxian-dbw

Copy link
Copy Markdown
Member Author

Jason Shirk (@lzybkr) Please let me know once a new version of PSRealine is published to PSGallery, so I make changes to use it for PSCore by default. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants