Closed mikaelstaldal closed 1 month ago
Can you provide a minimal example of a table that exhibits the issue? I can't reproduce this.
import com.github.ajalt.mordant.rendering.TextAlign
import com.github.ajalt.mordant.table.table
import com.github.ajalt.mordant.terminal.Terminal
fun main(args: Array<String>) {
Terminal().println(table {
captionTop("TopCaption", TextAlign.LEFT)
header { row("Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6", "Column 7", "Column 8", "Column 9") }
body {
row("Long important content in here", "Content 2", "Content 3", "Content 4", "Content 5", "Content 6", "Content 7", "Content 8", "Content 9")
}
})
}
But it seems like the problem only occurs in certain situations, such as when running within a Docker container.
Build a Docker image with the above program with Gradle:
plugins {
kotlin("jvm") version "2.0.10"
id("com.bmuschko.docker-java-application") version "9.4.0"
}
group = "com.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation("com.github.ajalt.mordant:mordant:2.7.2")
}
kotlin {
jvmToolchain(21)
}
docker {
javaApplication {
baseImage.set("eclipse-temurin:21")
}
}
And run it with docker run -it com.example/mordant-test:1.0-snapshot
If the terminal is less than 130 chars wide, than you see the problem. Try resize the terminal window after running it to see the problem come and go in real time.
I am using Ubuntu desktop Linux 24.04
Thanks for the repro!
I see that this fix has been released in 3.0.0. I am using both Clikt and Mordant, is the latest Clikt (4.4.0) compatible with Mordant 3.0.0?
No, but I'll release a new version of Clikt soon.
If you have a table with
captionTop
, and the table is too wide for the terminal (truncation of content occurs), extra blank lines are inserted between the caption and the table body.