mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-04 14:39:42 +02:00
feat: add CLAUDEMAN_SCREEN env var to inform Claude sessions
Claude sessions spawned by Claudeman now receive environment variables: - CLAUDEMAN_SCREEN=1 - Indicates running within Claudeman - CLAUDEMAN_SESSION_ID - The session's unique identifier - CLAUDEMAN_SCREEN_NAME - The GNU Screen session name (when applicable) This helps prevent Claude from attempting to kill its own screen session and allows sessions to be aware of their managed environment. Also updated the default CLAUDE.md template to document this behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+20
-3
@@ -551,7 +551,13 @@ export class Session extends EventEmitter {
|
||||
cols: 120,
|
||||
rows: 40,
|
||||
cwd: this.workingDir,
|
||||
env: { ...process.env, TERM: 'xterm-256color' },
|
||||
env: {
|
||||
...process.env,
|
||||
TERM: 'xterm-256color',
|
||||
// Inform Claude it's running within Claudeman (helps prevent self-termination)
|
||||
CLAUDEMAN_SCREEN: '1',
|
||||
CLAUDEMAN_SESSION_ID: this.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -707,7 +713,12 @@ export class Session extends EventEmitter {
|
||||
cols: 120,
|
||||
rows: 40,
|
||||
cwd: this.workingDir,
|
||||
env: { ...process.env, TERM: 'xterm-256color' },
|
||||
env: {
|
||||
...process.env,
|
||||
TERM: 'xterm-256color',
|
||||
CLAUDEMAN_SCREEN: '1',
|
||||
CLAUDEMAN_SESSION_ID: this.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -803,7 +814,13 @@ export class Session extends EventEmitter {
|
||||
cols: 120,
|
||||
rows: 40,
|
||||
cwd: this.workingDir,
|
||||
env: { ...process.env, TERM: 'xterm-256color' },
|
||||
env: {
|
||||
...process.env,
|
||||
TERM: 'xterm-256color',
|
||||
// Inform Claude it's running within Claudeman
|
||||
CLAUDEMAN_SCREEN: '1',
|
||||
CLAUDEMAN_SESSION_ID: this.id,
|
||||
},
|
||||
});
|
||||
|
||||
this._pid = this.ptyProcess.pid;
|
||||
|
||||
Reference in New Issue
Block a user