From 64263ee3fb9bfc9514733dddda26649f9a53a8ab Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Fri, 19 Jun 2026 14:32:52 +0200 Subject: [PATCH] standalone flag --- README.md | 3 +++ src/main/java/com/gregor/jprototerm/Main.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 26c6688..c877120 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,9 @@ After that, a bare `jprototerm` connects to the daemon and opens a window in the directory. If no daemon is running, `jprototerm` falls back to a standalone in-process window (today's behavior), so it always works. +For development testing, use `jprototerm --standalone` to skip the daemon even when one is +running. + To start the daemon automatically with your graphical session, enable the bundled **user** service (it's a user service, not a system one, because X11 needs a display — which only exists after you log in): diff --git a/src/main/java/com/gregor/jprototerm/Main.java b/src/main/java/com/gregor/jprototerm/Main.java index e42a1a5..938046b 100644 --- a/src/main/java/com/gregor/jprototerm/Main.java +++ b/src/main/java/com/gregor/jprototerm/Main.java @@ -4,7 +4,8 @@ package com.gregor.jprototerm; * Entry point and mode dispatch. A bare invocation is a thin client: it hands the request to a * running {@link Daemon}, or, if none is reachable, opens a single standalone window in this process * (today's behavior). {@code --daemon} runs the long-lived server that hosts every window in one - * JVM, so client launches skip cold JVM/JavaFX/GL startup. + * JVM, so client launches skip cold JVM/JavaFX/GL startup. {@code --standalone} skips daemon client + * mode and always opens an in-process window, which is useful while testing development builds. */ public final class Main { private Main() { @@ -14,15 +15,19 @@ public final class Main { // Match the renderer order the app was tuned for; honor an explicit override if present. System.setProperty("prism.order", System.getProperty("prism.order", "es2,sw")); + boolean standalone = false; for (String arg : args) { if (arg.equals("--daemon")) { Daemon.run(); return; } + if (arg.equals("--standalone")) { + standalone = true; + } } String workingDirectory = System.getProperty("user.dir"); - if (Daemon.tryClient(workingDirectory)) { + if (!standalone && Daemon.tryClient(workingDirectory)) { return; // a running daemon opened the window } // No daemon reachable: fall back to a standalone window; the JVM exits when it closes.