peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.05k stars 132 forks source link

MultiLineMode on Windows problems #98

Closed filimonov closed 6 years ago

filimonov commented 6 years ago
filimonov commented 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)?

peterh commented 6 years ago

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?

filimonov commented 6 years ago

Fixend in #101