ChrisPritchard / FSH

F# Shell with integrated F# scripting. Like Bash or Powershell, but better 'cause F#.
MIT License
258 stars 12 forks source link

[Windows] Crashes when window is resized to be smaller and accessing history #15

Closed akeeton closed 5 years ago

akeeton commented 5 years ago

To reproduce:

  1. Type echo 0123456789ABCDEF into the shell
  2. Resize the window to be a very small width
  3. Try to recall the previous line by pressing the up arrow, crashing the program

Screenshot of shell after reproduction step 1

Screenshot of shell after reproduction step 2

Screenshot of shell after reproduction step 3

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: left
Actual value was 30.
  Source=System.Console
  StackTrace:
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top) in E:\A\_work\297\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs:line 794
   at System.Console.SetCursorPosition(Int32 left, Int32 top) in E:\A\_work\297\s\corefx\src\System.Console\src\System\Console.cs:line 329
   at System.Console.set_CursorLeft(Int32 value) in E:\A\_work\297\s\corefx\src\System.Console\src\System\Console.cs:line 265
   at LineReader.reader@78.Invoke(Int32 priorIndex, String soFar, Int32 pos) in C:\Users\Akeeton\dev\FSH\src\LineReader.fs:line 86
   at LineReader.readLine(FSharpList`1 prior) in C:\Users\Akeeton\dev\FSH\src\LineReader.fs:line 172
   at Program.coreLoop@161.Invoke(FSharpList`1 prior) in C:\Users\Akeeton\dev\FSH\src\Program.fs:line 164
   at Program.main(String[] _arg1) in C:\Users\Akeeton\dev\FSH\src\Program.fs:line 171
ChrisPritchard commented 5 years ago

Cheers, I will fix this.

ChrisPritchard commented 5 years ago

Resolved in commit 8c734f8