mortal icon indicating copy to clipboard operation
mortal copied to clipboard

Windows: Correct result of `Terminal::size`

Open murarth opened this issue 5 years ago • 4 comments

Fixes #14

murarth avatar Jan 22 '20 05:01 murarth

Hmm... I'm getting the following error:

Error: Os { code: 87, kind: Other, message: "The parameter is incorrect." }                 
error: process didn't exit successfully: `target\debug\kilo.exe` (exit code: 1)   

prabirshrestha avatar Jan 22 '20 17:01 prabirshrestha

I did some digging and found that the error comes from the SetConsoleScreenBufferSize call here.

I'm not sure why that call is returning an error. The input parameters seem to be correct.

murarth avatar Jan 22 '20 19:01 murarth

@murarth any updates on this?

crossterm seems to do +1 for windows. Wondering if this is the same bug here too. https://github.com/crossterm-rs/crossterm/pull/176

prabirshrestha avatar Apr 19 '20 02:04 prabirshrestha

@prabirshrestha I'm not sure if that bug is related. I'm already adding 1 in the console size calculation here: https://github.com/murarth/mortal/pull/15/files#diff-fecc2cd4b8274c43f2394182f511ae08R1022

Also, adding 1 again when setting the console buffer size appears to have no effect.

murarth avatar Apr 19 '20 05:04 murarth