[PATCH v2 3/3] conhost: Fix delayed wrapping around when ENABLE_VIRTUAL_TERMINAL_PROCESSING is set.

Jacek Caban jacek at codeweavers.com
Fri Apr 2 07:38:01 CDT 2021


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ăncescu<gabrielopcode at 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



More information about the wine-devel mailing list