-
Notifications
You must be signed in to change notification settings - Fork 772
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
Dotnet fsi broken on inputs that take more than 1 line #14946
Comments
This repros on linux, not windows. |
I also experienced this on macOS. |
Repros on MacOS Screen.Recording.2023-05-02.at.5.12.09.PM.mov
|
It appears #14365 rewrote how line advances on FSharp.Compiler.Interactive.ReadLineConsole() to accommodate East Asian Width characters per https://www.unicode.org/reports/tr11/ Unfortunately, this fix advances the next line by setting Console.BufferHeight by incrementing it (which is not supported in UNIX). let moveCursorToNextLine c =
let charSize = x.GetCharacterSize(c)
if Console.CursorLeft + charSize > Utils.bufferWidth () then
if Console.CursorTop + 1 = Console.BufferHeight then
Console.BufferHeight <- Console.BufferHeight + 1
Cursor.Move(0) I was able to fix it from catastrophically failing on my Mac by wrapping the code that sets the BufferHeight it in a try block and writing a new line, but that breaks any editing functionality. |
The following update to console.fs to the function seems to resolve the issue on my Mac. let moveCursorToNextLine c =
let charSize = x.GetCharacterSize(c)
if Console.CursorLeft + charSize > Utils.bufferWidth () then
if Console.CursorTop + 1 = Console.BufferHeight then
try
Console.BufferHeight <- Console.BufferHeight + 1
with _ ->
// If we can't increase the buffer height, just write a newline.
Console.WriteLine()
// When we add a newline, we need to reflect the change in the anchor.
anchor <- { anchor with top = (anchor).top - 1 }
Cursor.Move(0) |
Got bitten by this today once again (#14160 (comment)) 😞 @sgoguen are you going to make a PR for it ? let moveCursorToNextLine c =
let charSize = x.GetCharacterSize(c)
if Console.CursorLeft + charSize > Utils.bufferWidth () then
if Console.CursorTop + 1 = Console.BufferHeight then
Console.WriteLine()
// When we add a newline, we need to reflect the change in the anchor.
anchor <- { anchor with top = (anchor).top - 1 }
Cursor.Move(0) |
It seems I'm not able to see it on macOS on 8.0rc2 not sure how to reproduce it. |
@vzarytovskii Assign a long string to a variable (string longer than terminal's width) and do it enough times to hit the bottom of the terminal (to trigger the scrolling) I was having it with RC1 this weekend, I'll try again with RC2 |
I can reproduce this bug in Homebrew's currently shipping dotnet 8 build: #16251 (comment) |
It didn't get to release for 8.0.100 for sure, I'd expect it in 8.0.200 |
Please provide a succinct description of the issue.
dotnet fsi breaks because it cannot read multiline expressions
Provide the steps required to reproduce the problem:
1 run dotnet fsi
2 insert any expr taking more than 1 line in console
3 reach the bottom of console
4 the interpreter goes crazy
7.0.2xx sdk:
issue does not exist in 7.0.1** sdk:
workaround is to revert back to 7.0.1
The text was updated successfully, but these errors were encountered: