Fix behaviour of "standard input" on Unix-like operating systems #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Edit: I have signed the Clojure contributor license agreement, but I've just realised that the Clojure docs say to create a Jira ticket and upload a patch to it instead of creating a pull request; does ClojureCLR follow the same workflow? I'm happy to do that if you'd prefer.
While experimenting with the .NET Core port of ClojureCLR, I noticed that on Linux (and likely also macOS), the REPL was unable to handle backspacing or the use of the cursor/arrow keys.
Here is a screencast of the bug.
After some experimentation, I found that the issue was with the implementation of
*in*
. I managed to fix it by replacingConsole.In
withConsole.OpenStandardInput()
. (I also updated the other two "standard streams" so that they all work the same way.)I have tested these changes on both Fedora Linux 32 and Microsoft Windows 10 with .NET Core 3.1. According to the Microsoft Docs I linked above this change will work on all .NET Framework, .NET Standard and .NET Core versions.
(Note: this pull request is set to merge to the
newframework
branch, as I believe this is only a bug on .NET Core.)If you would like me to make any changes to this pull request, I'm happy to do them, or if you want to make the changes yourself instead of merging this, that's fine with me too.
P.S. Thanks so much for all your work on this port, I'm really excited for the official .NET Core release of ClojureCLR (no matter how slow start-up has to be).