@dmsdc-ai/aigentry-telepty 0.1.37 → 0.1.39
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/cli.js +5 -5
- package/daemon.js +19 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -744,7 +744,7 @@ async function main() {
|
|
|
744
744
|
daemonWs.on('open', () => {
|
|
745
745
|
wsReady = true;
|
|
746
746
|
if (reconnectAttempts > 0) {
|
|
747
|
-
console
|
|
747
|
+
// Silent reconnect — no console output to avoid breaking TUI rendering
|
|
748
748
|
// Force CLI redraw by triggering SIGWINCH (resize +1/-1)
|
|
749
749
|
const origCols = child.cols || process.stdout.columns || 80;
|
|
750
750
|
const origRows = child.rows || process.stdout.rows || 30;
|
|
@@ -791,7 +791,7 @@ async function main() {
|
|
|
791
791
|
reconnectAttempts++;
|
|
792
792
|
const delay = Math.min(1000 * Math.pow(2, reconnectAttempts - 1), MAX_RECONNECT_DELAY);
|
|
793
793
|
if (reconnectAttempts === 1) {
|
|
794
|
-
console
|
|
794
|
+
// Silent — no console output to avoid breaking TUI rendering
|
|
795
795
|
}
|
|
796
796
|
reconnectTimer = setTimeout(() => {
|
|
797
797
|
reconnectTimer = null;
|
|
@@ -818,9 +818,9 @@ async function main() {
|
|
|
818
818
|
// Intercept terminal title escape sequences and prefix with session ID
|
|
819
819
|
const titlePrefix = `\u26A1 ${sessionId}`;
|
|
820
820
|
function rewriteTitleSequences(output) {
|
|
821
|
-
// Match OSC title sequences
|
|
822
|
-
return output.replace(/\x1b\]([02]);([^\x07]
|
|
823
|
-
return `\x1b]${code};${titlePrefix} | ${title}
|
|
821
|
+
// Match OSC title sequences with BEL (\x07) or ST (\x1b\\) terminator
|
|
822
|
+
return output.replace(/\x1b\]([02]);([^\x07\x1b]*?)(\x07|\x1b\\)/g, (match, code, title, term) => {
|
|
823
|
+
return `\x1b]${code};${titlePrefix} | ${title}${term}`;
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
826
|
|
package/daemon.js
CHANGED
|
@@ -647,6 +647,12 @@ app.post('/api/sessions/:id/inject', (req, res) => {
|
|
|
647
647
|
timeout: 3000, stdio: ['pipe', 'pipe', 'pipe']
|
|
648
648
|
});
|
|
649
649
|
console.log(`[INJECT+SUBMIT] WS text + kitty Return for ${id} (window ${windowId})`);
|
|
650
|
+
// Restore tab title after inject (Claude Code overwrites it)
|
|
651
|
+
try {
|
|
652
|
+
execSync(`kitty @ --to unix:${findKittySocket()} set-tab-title --match id:${windowId} '⚡ telepty :: ${id}'`, {
|
|
653
|
+
timeout: 2000, stdio: ['pipe', 'pipe', 'pipe']
|
|
654
|
+
});
|
|
655
|
+
} catch {}
|
|
650
656
|
} catch {
|
|
651
657
|
writeToSession('\r');
|
|
652
658
|
console.log(`[INJECT+SUBMIT] WS text + WS \\r fallback for ${id}`);
|
|
@@ -1090,8 +1096,19 @@ wss.on('connection', (ws, req) => {
|
|
|
1090
1096
|
};
|
|
1091
1097
|
sessions[sessionId] = autoSession;
|
|
1092
1098
|
console.log(`[WS] Auto-registered wrapped session ${sessionId} on reconnect`);
|
|
1093
|
-
// Trigger CLI redraw via kitty
|
|
1094
|
-
setTimeout(() =>
|
|
1099
|
+
// Trigger CLI redraw + set tab title via kitty after short delay
|
|
1100
|
+
setTimeout(() => {
|
|
1101
|
+
sendViaKitty(sessionId, '\x0c');
|
|
1102
|
+
const sock = findKittySocket();
|
|
1103
|
+
const wid = findKittyWindowId(sock, sessionId);
|
|
1104
|
+
if (sock && wid) {
|
|
1105
|
+
try {
|
|
1106
|
+
require('child_process').execSync(`kitty @ --to unix:${sock} set-tab-title --match id:${wid} '⚡ telepty :: ${sessionId}'`, {
|
|
1107
|
+
timeout: 2000, stdio: ['pipe', 'pipe', 'pipe']
|
|
1108
|
+
});
|
|
1109
|
+
} catch {}
|
|
1110
|
+
}
|
|
1111
|
+
}, 1000);
|
|
1095
1112
|
} else {
|
|
1096
1113
|
session.clients.add(ws);
|
|
1097
1114
|
}
|