On 4/1/21 6:43 PM, Gabriel Ivăncescu wrote:
Remember the fact we completed the entire line without altering the cursor. A newline is delayed so it wraps when writing a new character.
That sounds fine, but I don't think that you need a new variable for that. cursor_x == width means something like that already inside write_console call. Right now we make sure that it's normalize that before leaving, but we may just make other parts of code aware of that (somewhat like your previous patch did).
This can happen in practice when writing one character at a time to the console; right now it will keep overwriting the last character on the line.
Signed-off-by: Gabriel Ivăncescugabrielopcode@gmail.com
Note: I don't know why Windows sends a \b if we write two characters at once (i.e. "ab") to complete the line, but not if we write them one at a time ("a" then "b"). Doesn't the latter mess up the tty cursor? It seems like a Windows bug to me. For now I just skipped it in the tests, since Wine outputs it (which is proper when it syncs the tty cursor).
We should be able to just never emit those '\b's in those cases. Host should already handle that well, we just need to report it properly to console client.
Thanks, Jacek