This commit is contained in:
Gregor Lohaus
2026-05-27 14:04:26 +02:00
commit be0c0bb321
18 changed files with 1115 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
plugins {
application
}
dependencies {
implementation("dev.jlibghostty:jlibghostty:0.1.0-SNAPSHOT")
}
application {
mainClass.set("example.Main")
}
tasks.withType<JavaExec>().configureEach {
jvmArgs("--enable-native-access=ALL-UNNAMED")
}

View File

@@ -0,0 +1,18 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven {
url = uri(System.getenv("JLIBGHOSTTY_MAVEN_REPO") ?: "../../result/maven")
}
}
}
rootProject.name = "jlibghostty-consumer"

View File

@@ -0,0 +1,19 @@
package example;
import dev.jlibghostty.Ghostty;
import dev.jlibghostty.Terminal;
import dev.jlibghostty.TerminalOptions;
public final class Main {
private Main() {
}
public static void main(String[] args) {
System.out.println("paste safe: " + Ghostty.pasteIsSafe("hello"));
try (Terminal terminal = Ghostty.open(TerminalOptions.of(80, 24))) {
terminal.write("hello from libghostty-vt\r\n");
System.out.println(terminal.snapshot());
}
}
}