@dmsdc-ai/aigentry-telepty 0.1.37 → 0.1.38
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/daemon.js +19 -2
- package/package.json +1 -1
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
|
}
|