Closed filimonov closed 6 years ago
Removing that line fixes the issue https://github.com/peterh/liner/blob/3681c2a912330352991ecdd642f257efe5b85518/output_windows.go#L74
It was introduced by that commit https://github.com/peterh/liner/commit/0e4af131b90a9786839c8b1b01717be263e8555a#diff-170971f06d2d9d2a806adf528ef41c1c
Checked the description of the issue, but I not sure what was the exact problem on Windows 10. Do you remember that exactly was working wrong, and how to reproduce that (to avoid regression)?
When input is at the bottom of the screen, and not in multi-line mode, drawing a character at the end of the line causes Windows to scroll everything up (at least in recent versions of Windows). This eventually fills the screen (which is annoying in multi-line mode, and disastrous in the default single-line mode). So we have to leave an extra character for the cursor to 'live' in.
Multi-line mode was contributed by another user. It might need to change to break lines manually instead of trusting the terminal to wrap where it thinks the terminal might wrap. @flisky could you please take a look?
Fixend in #101
Operating System: Windows 7
Terminal Emulator: Command Prompt
Bug behaviour: For multiline mode liner works incorrect if line is wider than screen (misplace the cursor, clear previous lines, etc), please see the gif attached:
Expected behaviour: correct work in Multiline mode
Complete sample that reproduces the bug: