Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows + Kotlin/Native: Repaint issues reported (on legacy OS versions?) #97

Closed
bitspittle opened this issue Mar 19, 2023 · 2 comments
Closed
Labels
bug Something isn't working OS Related to one OS specifically (probably Windows...)

Comments

@bitspittle
Copy link
Contributor

The following Kotter program:

import com.varabyte.kotter.foundation.input.input
import com.varabyte.kotter.foundation.input.runUntilInputEntered
import com.varabyte.kotter.foundation.session
import com.varabyte.kotter.foundation.text.*

fun main() = session {
    section {
        textLine()
        p { textLine("Press Enter to quit"); input() }
    }.runUntilInputEntered()
}

should look like this:

win-press-enter-to-quit.mp4

But one user reported screenshots like this:

kotter-win-bad-1

kotter-win-bad-2

(what's happening is the commands that are trying to paint the flashing cursor aren't being understood by the underlying terminal, which is why [OK and [1F are getting rendered to the screen, and this is causing commands related to erase and rerender lines not to work as well)

So far, I cannot reproduce myself (using a Win11 VM), but I'd love it if anyone can tell me repro steps themselves. It's possible that this only breaks on older (e.g. Win7, Win8) versions of Windows.


If it's decided it's worth fixing this bug, it's probably a non-trivial amount of work. We'd have to basically intercept and render commands ourselves (similar to what I'm doing in the virtual terminal). There may be a dll / c library out there I can use instead of doing things myself, but I'm not sure.

For now, I'm going to assume the number of users affected by this is very small so I'm not going to prioritize it at the moment unless people can chime in explaining why legacy Windows support is so important or give me ways I can repro this issue on a more recent Windows version. (Especially since Win7/Win8 have been marked end of life)

@bitspittle bitspittle added bug Something isn't working OS Related to one OS specifically (probably Windows...) labels Mar 19, 2023
@bitspittle
Copy link
Contributor Author

OK, I was given steps to reproduce it. Basically...

  1. In the settings for terminals, set the default terminal application to "Windows Console Host"

windows-console-host

  1. Double-click on the exe
win-double-click-with-console-host.mp4

Apparently this might be a common issue for Win10 users, where the terminal isn't available by default.

@bitspittle
Copy link
Contributor Author

Turns out my concerns above were wrong. I was just initializing the windows console APIs incorrectly, and the legacy hosts were less forgiving.

This is fixed in rc3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS Related to one OS specifically (probably Windows...)
Projects
None yet
Development

No branches or pull requests

1 participant