From cf98469d5df88070f552ca83a61641f7c1508fb8 Mon Sep 17 00:00:00 2001 From: onefang Date: Sat, 24 Jul 2021 01:10:52 +1000 Subject: Don't join the tmux session if we don't have to. --- src/sledjchisl/sledjchisl.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 9342faf..e6caa67 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -6983,14 +6983,14 @@ jit library is loaded or the JIT compiler will not be activated. if (!WIFEXITED(i)) E("tmux select-pane command failed!"); } + // Join the session. + memset(toybuf, 0, sizeof(toybuf)); + snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-window -t '%s' \\; attach-session -t '%s'", Tcmd, scRun, Tsocket, Tconsole, Tconsole); + i = system(toybuf); + if (!WIFEXITED(i)) + E("tmux attach-session command failed! %s", toybuf); + goto finished; } - // Join the session. - memset(toybuf, 0, sizeof(toybuf)); - snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-window -t '%s' \\; attach-session -t '%s'", Tcmd, scRun, Tsocket, Tconsole, Tconsole); - i = system(toybuf); - if (!WIFEXITED(i)) - E("tmux attach-session command failed! %s", toybuf); - goto finished; } else E("tmux list-sessions command failed! %s", toybuf); @@ -7549,6 +7549,17 @@ fcgiDone: I("ROBUST is done starting up."); free(d); } + else if ((0 == toys.optc) && (checkSimIsRunning("ROBUST"))) + { + // Join the session. + doTmuxCmd("select-window -t '%s' \\; attach-session -t '%s'", Tconsole, Tconsole); +// memset(toybuf, 0, sizeof(toybuf)); +// snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-window -t '%s' \\; attach-session -t '%s'", Tcmd, scRun, Tsocket, Tconsole, Tconsole); +// i = system(toybuf); +// if (!WIFEXITED(i)) +// E("tmux attach-session command failed! %s", toybuf); + goto finished; + } /* sims = -- Note these are .shini / tmux tab short names. -- cgit v1.1