diff options
author | onefang | 2021-07-22 00:34:15 +1000 |
---|---|---|
committer | onefang | 2021-07-22 00:34:15 +1000 |
commit | 05e175bc49531fed104de28e26891c2875a74e2e (patch) | |
tree | 952abed0156a9d462ca202c33341f3a7c0a32a4e /src/sledjchisl/sledjchisl.c | |
parent | If no file given for IARs, use users name and put it in the usual backups dir... (diff) | |
download | opensim-SC-05e175bc49531fed104de28e26891c2875a74e2e.zip opensim-SC-05e175bc49531fed104de28e26891c2875a74e2e.tar.gz opensim-SC-05e175bc49531fed104de28e26891c2875a74e2e.tar.bz2 opensim-SC-05e175bc49531fed104de28e26891c2875a74e2e.tar.xz |
Set the tmux pane title and active pane border.
Diffstat (limited to '')
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 41 |
1 files changed, 30 insertions, 11 deletions
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. | |||
6949 | { | 6949 | { |
6950 | snprintf(toybuf, sizeof(toybuf), | 6950 | snprintf(toybuf, sizeof(toybuf), |
6951 | "%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'", | 6951 | "%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'", |
6952 | "; select-pane -t 0 -T 'SledjChisl'; select-pane -t 1 -T 'ROBUST'", | ||
6952 | Tcmd, scRun, Tsocket, Tconsole, Ttab, Tconsole, scRoot); | 6953 | Tcmd, scRun, Tsocket, Tconsole, Ttab, Tconsole, scRoot); |
6953 | } | 6954 | } |
6954 | else | 6955 | else |
6955 | { | 6956 | { |
6956 | // 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. | 6957 | // 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. |
6957 | // 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. | 6958 | // 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. |
6958 | snprintf(toybuf, sizeof(toybuf), | 6959 | snprintf(toybuf, sizeof(toybuf), |
6959 | "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'", | 6960 | "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'", |
6960 | scUser, Tcmd, scRun, Tsocket, Tconsole, Ttab, Tconsole, scRoot); | 6961 | scUser, Tcmd, scRun, Tsocket, Tconsole, Ttab, Tconsole, scRoot); |
6961 | } | 6962 | } |
6962 | i = system(toybuf); | 6963 | i = system(toybuf); |
6963 | if (!WIFEXITED(i)) | 6964 | if (!WIFEXITED(i)) |
6964 | E("tmux new-session command failed! %s", toybuf); | 6965 | E("tmux new-session command failed! %s", toybuf); |
6966 | else | ||
6967 | { | ||
6968 | snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-pane -t 0 -T 'SledjChisl'", Tcmd, scRun, Tsocket); | ||
6969 | i = system(toybuf); | ||
6970 | if (!WIFEXITED(i)) | ||
6971 | E("tmux select-pane command failed!"); | ||
6972 | } | ||
6965 | } | 6973 | } |
6966 | // Join the session. | 6974 | // Join the session. |
6967 | memset(toybuf, 0, sizeof(toybuf)); | 6975 | memset(toybuf, 0, sizeof(toybuf)); |
@@ -7523,6 +7531,10 @@ T("ARGS - %i |%s| |%s|", currentMode, toys.optargs[0], target); | |||
7523 | c = xmprintf("mono Robust.exe -inidirectory=%s/config/ROBUST", scRoot); | 7531 | c = xmprintf("mono Robust.exe -inidirectory=%s/config/ROBUST", scRoot); |
7524 | sendTmuxCmd(d, c); | 7532 | sendTmuxCmd(d, c); |
7525 | free(c); | 7533 | free(c); |
7534 | c = xmprintf("%s %s/%s select-pane -t 1 -T 'ROBUST'", Tcmd, scRun, Tsocket); | ||
7535 | i = system(c); | ||
7536 | if (!WIFEXITED(i)) | ||
7537 | E("tmux select-pane command failed!"); | ||
7526 | waitTmuxText(d, "INITIALIZATION COMPLETE FOR ROBUST"); | 7538 | waitTmuxText(d, "INITIALIZATION COMPLETE FOR ROBUST"); |
7527 | I("ROBUST is done starting up."); | 7539 | I("ROBUST is done starting up."); |
7528 | // la = waitLoadAverage(la, loadAverageInc / 3.0, simTimeOut / 3); | 7540 | // la = waitLoadAverage(la, loadAverageInc / 3.0, simTimeOut / 3); |
@@ -7663,17 +7675,24 @@ sims = -- Note these are .shini / tmux tab short names. | |||
7663 | E("tmux new-window command failed!"); | 7675 | E("tmux new-window command failed!"); |
7664 | else | 7676 | else |
7665 | { | 7677 | { |
7666 | if (0 == doWait) | 7678 | snprintf(toybuf, sizeof(toybuf), "%s %s/%s select-pane -t %s.0 -T '%s'", Tcmd, scRun, Tsocket, nm, name); |
7667 | { | 7679 | r = system(toybuf); |
7668 | memset(toybuf, 0, sizeof(toybuf)); | 7680 | if (!WIFEXITED(r)) |
7669 | snprintf(toybuf, sizeof(toybuf), "INITIALIZATION COMPLETE FOR %s", name); | 7681 | E("tmux select-pane command failed!"); |
7670 | waitTmuxText(nm, toybuf); | ||
7671 | I("%s is done starting up.", name); | ||
7672 | la = waitLoadAverage(la, loadAverageInc, simTimeOut); | ||
7673 | } | ||
7674 | else | 7682 | else |
7675 | I("Not waiting for %s to finish starting up.", name); | 7683 | { |
7676 | count++; | 7684 | if (0 == doWait) |
7685 | { | ||
7686 | memset(toybuf, 0, sizeof(toybuf)); | ||
7687 | snprintf(toybuf, sizeof(toybuf), "INITIALIZATION COMPLETE FOR %s", name); | ||
7688 | waitTmuxText(nm, toybuf); | ||
7689 | I("%s is done starting up.", name); | ||
7690 | la = waitLoadAverage(la, loadAverageInc, simTimeOut); | ||
7691 | } | ||
7692 | else | ||
7693 | I("Not waiting for %s to finish starting up.", name); | ||
7694 | count++; | ||
7695 | } | ||
7677 | } | 7696 | } |
7678 | free(newPath); | 7697 | free(newPath); |
7679 | free(path); | 7698 | free(path); |