single-instance application for Linux;
authorwenzelm
Mon, 14 Sep 2015 16:08:27 +0200
changeset 61172 0a1b62bbbdf9
parent 61171 2a56a53d78f9
child 61173 5f3f203a38ad
single-instance application for Linux;
Admin/Linux/Isabelle.run
--- a/Admin/Linux/Isabelle.run	Mon Sep 14 16:06:55 2015 +0200
+++ b/Admin/Linux/Isabelle.run	Mon Sep 14 16:08:27 2015 +0200
@@ -32,8 +32,13 @@
 #paranoia setting -- avoid problems of Java/Swing versus XIM/IBus etc.
 unset XMODIFIERS
 
-exec "$ISABELLE_HOME/contrib/jdk/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}/jre/bin/java" \
-  "-Disabelle.home=$ISABELLE_HOME" "${JAVA_OPTIONS[@]}" \
-  -classpath "{CLASSPATH}" \
-  "-splash:$ISABELLE_HOME/lib/logo/isabelle.gif" \
-  isabelle.Main "$@"
+if "$ISABELLE_HOME/bin/isabelle" jedit_client -c
+then
+  "$ISABELLE_HOME/bin/isabelle" jedit_client "$@"
+else
+  exec "$ISABELLE_HOME/contrib/jdk/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}/jre/bin/java" \
+    "-Disabelle.home=$ISABELLE_HOME" "${JAVA_OPTIONS[@]}" \
+    -classpath "{CLASSPATH}" \
+    "-splash:$ISABELLE_HOME/lib/logo/isabelle.gif" \
+    isabelle.Main -server="$("$ISABELLE_HOME/bin/isabelle" jedit_client -n)" "$@"
+fi