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 Virtual Terminal Incorrectly Sizes Border #105

Open
grnt426 opened this issue Jan 13, 2024 · 4 comments
Open

Windows Virtual Terminal Incorrectly Sizes Border #105

grnt426 opened this issue Jan 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@grnt426
Copy link
Contributor

grnt426 commented Jan 13, 2024

Describe the bug
Virtual terminals on Windows 10 incorrectly calculate the length of bordered text, causing the header and footer to be shorter than expected.

To Reproduce

build.gradle.kts

plugins {
    kotlin("jvm") version "1.9.0"
    application
}

dependencies {
    implementation("com.varabyte.kotter:kotter-jvm:1.1.1")
}

kotlin {
    jvmToolchain(17)
}

application {
    mainClass.set("MainKt")
}

Main.KT

session{
    section {
        bordered {
            textLine("Hello World!")
            textLine("Row 2!")
        }
    }.run()
}

Expected behavior
After bundling the above application into a jar and executing it on Powershell 7.4.1, I see the below

┌────────────┐
│Hello World!│
│Row 2!      │
└────────────┘
┌──┐
│AA│
│b │
└──┘

Screenshots
When running inside a virtual terminal launched from IntelliJ, or forcibly launched from the Jar with the session(terminal = VirtualTerminal.create()) option, it renders with incorrect length calculated for the header and footer.

base example

very long border

AAb

Desktop (please complete the following information):

  • OS: Windows 10 64bit
  • Java 17
  • Kotlin 1.9.0
  • Kotter 1.1.1
  • IntelliJ
  • Gradle 8.2

** Additional Notes:**
I included the text from Powershell as it formatted and displayed correctly, however I couldn't get the text copied out of the virtual terminal (is that possible?), so included only screenshots. I can include screenshots of the correct Powershell 7 behavior if requested.

@grnt426 grnt426 added the bug Something isn't working label Jan 13, 2024
@bitspittle
Copy link
Contributor

I'm not sure I can do anything about that, unfortunately. I recommend the ASCII border set in that case, or changing the font?

@grnt426
Copy link
Contributor Author

grnt426 commented Jan 31, 2024

How can the font of a VirtualTerminal be selected? I don't see the option inside VirtualTerminal, Session, or Section.

@bitspittle
Copy link
Contributor

@grnt426

* @param fontOverride A path to a font file resource (e.g. ttf) for an alternate text look and feel.

@bitspittle
Copy link
Contributor

@grnt426 did you ever resolve this issue on your end, with the recommendation for changing the font?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants