Skip to content

Windows: Correct result of Terminal::size#15

Open
murarth wants to merge 2 commits into
masterfrom
windows-fix-size
Open

Windows: Correct result of Terminal::size#15
murarth wants to merge 2 commits into
masterfrom
windows-fix-size

Conversation

@murarth

@murarth murarth commented Jan 22, 2020

Copy link
Copy Markdown
Owner

Fixes #14

@prabirshrestha

Copy link
Copy Markdown

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)   

@murarth

murarth commented Jan 22, 2020

Copy link
Copy Markdown
Owner Author

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.

@prabirshrestha

Copy link
Copy Markdown

@murarth any updates on this?

crossterm seems to do +1 for windows. Wondering if this is the same bug here too. crossterm-rs/crossterm#176

@murarth

murarth commented Apr 19, 2020

Copy link
Copy Markdown
Owner Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

terminal size is not correctly reported on windows

2 participants