From 05e175bc49531fed104de28e26891c2875a74e2e Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 22 Jul 2021 00:34:15 +1000 Subject: Set the tmux pane title and active pane border. --- src/sledjchisl/sledjchisl.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'src/sledjchisl') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 0ea29a3..9297772 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -6949,19 +6949,27 @@ jit library is loaded or the JIT compiler will not be activated. { snprintf(toybuf, sizeof(toybuf), "%s %s/%s new-session -d -s %s -n '%s' \\; split-window -bhp 50 -t '%s:' bash -c '/usr/bin/valgrind --leak-check=full ./sledjchisl; cd %s; bash'", + "; select-pane -t 0 -T 'SledjChisl'; select-pane -t 1 -T 'ROBUST'", Tcmd, scRun, Tsocket, Tconsole, Ttab, Tconsole, scRoot); } else { // The sudo is only so that the session is owned by opensim, otherwise it's owned by whoever ran this script, which is a likely security hole. // After the session is created, we rely on the scRun directory to be group sticky, so that anyone in the opensim group can attach to the tmux socket. - snprintf(toybuf, sizeof(toybuf), + snprintf(toybuf, sizeof(toybuf), "sudo -Hu %s %s %s/%s new-session -d -s %s -n '%s' \\; split-window -bhp 50 -t '%s:' bash -c '/usr/bin/valgrind --leak-check=full ./sledjchisl; cd %s; bash'", scUser, Tcmd, scRun, Tsocket, Tconsole, Ttab, Tconsole, scRoot); } i = system(toybuf); if (!WIFEXITED(i)) E("tmux new-session command failed! %s", toybuf); + else + { + snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-pane -t 0 -T 'SledjChisl'", Tcmd, scRun, Tsocket); + i = system(toybuf); + if (!WIFEXITED(i)) + E("tmux select-pane command failed!"); + } } // Join the session. memset(toybuf, 0, sizeof(toybuf)); @@ -7523,6 +7531,10 @@ T("ARGS - %i |%s| |%s|", currentMode, toys.optargs[0], target); c = xmprintf("mono Robust.exe -inidirectory=%s/config/ROBUST", scRoot); sendTmuxCmd(d, c); free(c); + c = xmprintf("%s %s/%s select-pane -t 1 -T 'ROBUST'", Tcmd, scRun, Tsocket); + i = system(c); + if (!WIFEXITED(i)) + E("tmux select-pane command failed!"); waitTmuxText(d, "INITIALIZATION COMPLETE FOR ROBUST"); I("ROBUST is done starting up."); // la = waitLoadAverage(la, loadAverageInc / 3.0, simTimeOut / 3); @@ -7663,17 +7675,24 @@ sims = -- Note these are .shini / tmux tab short names. E("tmux new-window command failed!"); else { - if (0 == doWait) - { - memset(toybuf, 0, sizeof(toybuf)); - snprintf(toybuf, sizeof(toybuf), "INITIALIZATION COMPLETE FOR %s", name); - waitTmuxText(nm, toybuf); - I("%s is done starting up.", name); - la = waitLoadAverage(la, loadAverageInc, simTimeOut); - } + snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-pane -t %s.0 -T '%s'", Tcmd, scRun, Tsocket, nm, name); + r = system(toybuf); + if (!WIFEXITED(r)) + E("tmux select-pane command failed!"); else - I("Not waiting for %s to finish starting up.", name); - count++; + { + if (0 == doWait) + { + memset(toybuf, 0, sizeof(toybuf)); + snprintf(toybuf, sizeof(toybuf), "INITIALIZATION COMPLETE FOR %s", name); + waitTmuxText(nm, toybuf); + I("%s is done starting up.", name); + la = waitLoadAverage(la, loadAverageInc, simTimeOut); + } + else + I("Not waiting for %s to finish starting up.", name); + count++; + } } free(newPath); free(path); -- cgit v1.1