@dmsdc-ai/aigentry-telepty 0.1.19 → 0.1.20

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.
Files changed (2) hide show
  1. package/cli.js +11 -1
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -770,9 +770,19 @@ async function main() {
770
770
  }
771
771
  });
772
772
 
773
+ // Intercept terminal title escape sequences and prefix with session ID
774
+ const titlePrefix = `\u26A1 ${sessionId}`;
775
+ function rewriteTitleSequences(output) {
776
+ // Match OSC title sequences: \x1b]0;TITLE\x07 or \x1b]2;TITLE\x07
777
+ return output.replace(/\x1b\]([02]);([^\x07]*)\x07/g, (match, code, title) => {
778
+ return `\x1b]${code};${titlePrefix} | ${title}\x07`;
779
+ });
780
+ }
781
+
773
782
  // Relay PTY output to current terminal + send to daemon for attach clients
774
783
  child.onData((data) => {
775
- process.stdout.write(data);
784
+ const rewritten = rewriteTitleSequences(data);
785
+ process.stdout.write(rewritten);
776
786
  if (wsReady && daemonWs.readyState === 1) {
777
787
  daemonWs.send(JSON.stringify({ type: 'output', data }));
778
788
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aigentry-telepty",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "aigentry-telepty": "install.js",