@dmsdc-ai/aigentry-telepty 0.0.16 → 0.0.18

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 (3) hide show
  1. package/cli.js +2 -0
  2. package/daemon.js +14 -1
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -178,6 +178,8 @@ async function manageInteractive() {
178
178
  ]);
179
179
  if (!id || !command) continue;
180
180
 
181
+ await ensureDaemonRunning();
182
+
181
183
  const cols = process.stdout.columns || 80;
182
184
  const rows = process.stdout.rows || 30;
183
185
  try {
package/daemon.js CHANGED
@@ -48,12 +48,25 @@ app.post('/api/sessions/spawn', (req, res) => {
48
48
 
49
49
  try {
50
50
  console.log(`[SPAWN] Spawning ${shell} with args:`, shellArgs, "in cwd:", cwd);
51
+
52
+ // Create a custom prompt for Linux/Mac so the user sees the session ID.
53
+ // For bash/zsh, we can inject a custom PS1 variable.
54
+ let customEnv = { ...process.env, TERM: isWin ? undefined : 'xterm-256color', TELEPTY_SESSION_ID: session_id };
55
+
56
+ if (!isWin) {
57
+ if (command.includes('bash')) {
58
+ customEnv.PS1 = `\\[\\e[36m\\][telepty: ${session_id}]\\[\\e[0m\\] \\w \\$ `;
59
+ } else if (command.includes('zsh')) {
60
+ customEnv.PROMPT = `%F{cyan}[telepty: ${session_id}]%f %~ %# `;
61
+ }
62
+ }
63
+
51
64
  const ptyProcess = pty.spawn(shell, shellArgs, {
52
65
  name: isWin ? 'Windows Terminal' : 'xterm-256color',
53
66
  cols: parseInt(cols),
54
67
  rows: parseInt(rows),
55
68
  cwd,
56
- env: { ...process.env, TERM: isWin ? undefined : 'xterm-256color', TELEPTY_SESSION_ID: session_id }
69
+ env: customEnv
57
70
  });
58
71
 
59
72
  sessions[session_id] = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aigentry-telepty",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "telepty": "cli.js",