pty-manager 1.9.0 → 1.9.2
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/dist/index.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -8
- package/dist/index.mjs.map +1 -1
- package/dist/pty-worker.js +18 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -561,6 +561,8 @@ var PTYSession = class _PTYSession extends EventEmitter {
|
|
|
561
561
|
switch (type) {
|
|
562
562
|
case "api_key":
|
|
563
563
|
return "api_key";
|
|
564
|
+
case "cli_auth":
|
|
565
|
+
return "cli_auth";
|
|
564
566
|
case "device_code":
|
|
565
567
|
return "device_code";
|
|
566
568
|
case "oauth":
|
|
@@ -860,14 +862,7 @@ var PTYSession = class _PTYSession extends EventEmitter {
|
|
|
860
862
|
const command = this.adapter.getCommand();
|
|
861
863
|
const args = this.adapter.getArgs(this.config);
|
|
862
864
|
const adapterEnv = this.adapter.getEnv(this.config);
|
|
863
|
-
const env =
|
|
864
|
-
...process.env,
|
|
865
|
-
...adapterEnv,
|
|
866
|
-
...this.config.env,
|
|
867
|
-
// Force terminal settings
|
|
868
|
-
TERM: "xterm-256color",
|
|
869
|
-
COLORTERM: "truecolor"
|
|
870
|
-
};
|
|
865
|
+
const env = _PTYSession.buildSpawnEnv(this.config, adapterEnv);
|
|
871
866
|
this.logger.info(
|
|
872
867
|
{ sessionId: this.id, command, args: args.join(" ") },
|
|
873
868
|
"Starting PTY session"
|
|
@@ -1249,6 +1244,21 @@ var PTYSession = class _PTYSession extends EventEmitter {
|
|
|
1249
1244
|
}
|
|
1250
1245
|
}
|
|
1251
1246
|
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Build the environment object for spawning a PTY process.
|
|
1249
|
+
* Merges base env (process.env unless opted out), adapter env, and config env,
|
|
1250
|
+
* with TERM/COLORTERM always forced.
|
|
1251
|
+
*/
|
|
1252
|
+
static buildSpawnEnv(config, adapterEnv) {
|
|
1253
|
+
const baseEnv = config.inheritProcessEnv !== false ? process.env : {};
|
|
1254
|
+
return {
|
|
1255
|
+
...baseEnv,
|
|
1256
|
+
...adapterEnv,
|
|
1257
|
+
...config.env,
|
|
1258
|
+
TERM: "xterm-256color",
|
|
1259
|
+
COLORTERM: "truecolor"
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1252
1262
|
/**
|
|
1253
1263
|
* Normalize a list of key names for SPECIAL_KEYS lookup.
|
|
1254
1264
|
*
|