wjlroe / bim

A text editor in Rust, very experimental [mirror of gitlab repo]
https://gitlab.com/wjlroe/bim
GNU General Public License v3.0
5 stars 0 forks source link

Window size ioctl not always accurate on Windows #3

Open wjlroe opened 7 years ago

wjlroe commented 7 years ago

Sometimes, when you run bash on Ubuntu on Windows, the size of the terminal reported by ioctl is inaccurate. It seems to happen when you open the default window size (let's say that's 22 columns high), then use Windows+Left to snap it to the left half of the screen, if you query the window size now, the ioctl will not have changed (sometimes), but using the move cursor method will get the full window size. This means, if we have numbers from both ioctl and move cursor, we should prefer the move cursor method until finding out that doesn't work somewhere else.

wjlroe commented 7 years ago

Running vim or jove sometimes fixes it. Also it seems repeatable by:

  1. Open bash on Ubuntu on Windows
  2. run kilo/bim
  3. resize window
  4. quit kilo/bim
  5. open kilo/bim