tmex-cli 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime/server.js +107 -0
- package/package.json +1 -1
package/dist/runtime/server.js
CHANGED
|
@@ -22493,6 +22493,7 @@ var config = {
|
|
|
22493
22493
|
notificationThrottleSecondsDefault: Number.parseInt(getEnv("TMEX_NOTIFICATION_THROTTLE_SECONDS", "3"), 10),
|
|
22494
22494
|
tmuxAllowPassthrough: getBooleanEnv("TMEX_TMUX_ALLOW_PASSTHROUGH", false),
|
|
22495
22495
|
tmuxTermProgram: getEnv("TMEX_TMUX_TERM_PROGRAM", "ghostty"),
|
|
22496
|
+
tmuxWindowStyle: getEnv("TMEX_TMUX_WINDOW_STYLE", "fg=#d0d0d0,bg=#262626"),
|
|
22496
22497
|
sshReconnectMaxRetriesDefault: Number.parseInt(getEnv("TMEX_SSH_RECONNECT_MAX_RETRIES", "2"), 10),
|
|
22497
22498
|
sshReconnectDelaySecondsDefault: Number.parseInt(getEnv("TMEX_SSH_RECONNECT_DELAY_SECONDS", "10"), 10),
|
|
22498
22499
|
languageDefault: getEnv("TMEX_DEFAULT_LANGUAGE", "en_US"),
|
|
@@ -53392,6 +53393,20 @@ function isControlModeSupported(version2) {
|
|
|
53392
53393
|
return version2.minor >= MIN_CONTROL_MODE_VERSION.minor;
|
|
53393
53394
|
}
|
|
53394
53395
|
|
|
53396
|
+
// ../../apps/gateway/src/tmux-client/window-style.ts
|
|
53397
|
+
var WINDOW_STYLE_PATTERN = /^[A-Za-z0-9#=,]+$/;
|
|
53398
|
+
function resolveTmuxWindowStyle(value) {
|
|
53399
|
+
const style = value.trim();
|
|
53400
|
+
if (!style || style.toLowerCase() === "off") {
|
|
53401
|
+
return null;
|
|
53402
|
+
}
|
|
53403
|
+
if (!WINDOW_STYLE_PATTERN.test(style)) {
|
|
53404
|
+
console.warn(`[tmex] ignoring invalid TMEX_TMUX_WINDOW_STYLE: ${style}`);
|
|
53405
|
+
return null;
|
|
53406
|
+
}
|
|
53407
|
+
return style;
|
|
53408
|
+
}
|
|
53409
|
+
|
|
53395
53410
|
// ../../apps/gateway/src/tmux-client/local-external-connection.ts
|
|
53396
53411
|
var CONTROL_MAX_RESTARTS = 3;
|
|
53397
53412
|
var CONTROL_RESTART_DELAY_MS = 500;
|
|
@@ -53656,6 +53671,52 @@ class LocalExternalTmuxConnection {
|
|
|
53656
53671
|
]);
|
|
53657
53672
|
}
|
|
53658
53673
|
}
|
|
53674
|
+
await this.runTmuxAllowFailure([
|
|
53675
|
+
"set-environment",
|
|
53676
|
+
"-t",
|
|
53677
|
+
this.sessionName,
|
|
53678
|
+
"COLORTERM",
|
|
53679
|
+
"truecolor"
|
|
53680
|
+
]);
|
|
53681
|
+
await this.configureWindowStyle();
|
|
53682
|
+
}
|
|
53683
|
+
async configureWindowStyle() {
|
|
53684
|
+
const windowStyle = resolveTmuxWindowStyle(config.tmuxWindowStyle);
|
|
53685
|
+
if (!windowStyle) {
|
|
53686
|
+
return;
|
|
53687
|
+
}
|
|
53688
|
+
await this.runTmuxAllowFailure([
|
|
53689
|
+
"set-hook",
|
|
53690
|
+
"-t",
|
|
53691
|
+
this.sessionName,
|
|
53692
|
+
"after-new-window",
|
|
53693
|
+
`set-option -w window-style '${windowStyle}'`
|
|
53694
|
+
]);
|
|
53695
|
+
const windows = await this.runTmuxAllowFailure([
|
|
53696
|
+
"list-windows",
|
|
53697
|
+
"-t",
|
|
53698
|
+
this.sessionName,
|
|
53699
|
+
"-F",
|
|
53700
|
+
"#{window_id}"
|
|
53701
|
+
]);
|
|
53702
|
+
if (windows.exitCode !== 0) {
|
|
53703
|
+
return;
|
|
53704
|
+
}
|
|
53705
|
+
for (const line of windows.stdout.split(`
|
|
53706
|
+
`)) {
|
|
53707
|
+
const windowId = line.trim();
|
|
53708
|
+
if (!windowId) {
|
|
53709
|
+
continue;
|
|
53710
|
+
}
|
|
53711
|
+
await this.runTmuxAllowFailure([
|
|
53712
|
+
"set-option",
|
|
53713
|
+
"-w",
|
|
53714
|
+
"-t",
|
|
53715
|
+
windowId,
|
|
53716
|
+
"window-style",
|
|
53717
|
+
windowStyle
|
|
53718
|
+
]);
|
|
53719
|
+
}
|
|
53659
53720
|
}
|
|
53660
53721
|
async assertControlModeSupport() {
|
|
53661
53722
|
const result = await this.runTmuxAllowFailure(["-V"]);
|
|
@@ -54839,6 +54900,52 @@ class SshExternalTmuxConnection {
|
|
|
54839
54900
|
]);
|
|
54840
54901
|
}
|
|
54841
54902
|
}
|
|
54903
|
+
await this.runTmuxAllowFailure([
|
|
54904
|
+
"set-environment",
|
|
54905
|
+
"-t",
|
|
54906
|
+
this.sessionName,
|
|
54907
|
+
"COLORTERM",
|
|
54908
|
+
"truecolor"
|
|
54909
|
+
]);
|
|
54910
|
+
await this.configureWindowStyle();
|
|
54911
|
+
}
|
|
54912
|
+
async configureWindowStyle() {
|
|
54913
|
+
const windowStyle = resolveTmuxWindowStyle(config.tmuxWindowStyle);
|
|
54914
|
+
if (!windowStyle) {
|
|
54915
|
+
return;
|
|
54916
|
+
}
|
|
54917
|
+
await this.runTmuxAllowFailure([
|
|
54918
|
+
"set-hook",
|
|
54919
|
+
"-t",
|
|
54920
|
+
this.sessionName,
|
|
54921
|
+
"after-new-window",
|
|
54922
|
+
`set-option -w window-style '${windowStyle}'`
|
|
54923
|
+
]);
|
|
54924
|
+
const windows = await this.runTmuxAllowFailure([
|
|
54925
|
+
"list-windows",
|
|
54926
|
+
"-t",
|
|
54927
|
+
this.sessionName,
|
|
54928
|
+
"-F",
|
|
54929
|
+
"#{window_id}"
|
|
54930
|
+
]);
|
|
54931
|
+
if (windows.exitCode !== 0) {
|
|
54932
|
+
return;
|
|
54933
|
+
}
|
|
54934
|
+
for (const line of windows.stdout.split(`
|
|
54935
|
+
`)) {
|
|
54936
|
+
const windowId = line.trim();
|
|
54937
|
+
if (!windowId) {
|
|
54938
|
+
continue;
|
|
54939
|
+
}
|
|
54940
|
+
await this.runTmuxAllowFailure([
|
|
54941
|
+
"set-option",
|
|
54942
|
+
"-w",
|
|
54943
|
+
"-t",
|
|
54944
|
+
windowId,
|
|
54945
|
+
"window-style",
|
|
54946
|
+
windowStyle
|
|
54947
|
+
]);
|
|
54948
|
+
}
|
|
54842
54949
|
}
|
|
54843
54950
|
async ensureGhosttyTerminfo() {
|
|
54844
54951
|
try {
|