lunel-cli 0.1.11 → 0.1.12
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.js +20 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as os from "os";
|
|
|
9
9
|
import { spawn, execSync } from "child_process";
|
|
10
10
|
import { createServer } from "net";
|
|
11
11
|
const PROXY_URL = process.env.LUNEL_PROXY_URL || "https://gateway.lunel.dev";
|
|
12
|
-
const VERSION = "0.1.
|
|
12
|
+
const VERSION = "0.1.11";
|
|
13
13
|
// Root directory - sandbox all file operations to this
|
|
14
14
|
const ROOT_DIR = process.cwd();
|
|
15
15
|
// Simple ANSI parser for terminal state
|
|
@@ -711,6 +711,10 @@ function handleTerminalSpawn(payload) {
|
|
|
711
711
|
let proc;
|
|
712
712
|
const isWindows = os.platform() === 'win32';
|
|
713
713
|
console.log(`[Terminal] Spawning shell: ${shell} in ${ROOT_DIR}`);
|
|
714
|
+
// Force a simple prompt and disable fancy terminal features
|
|
715
|
+
cleanEnv['PS1'] = '$ ';
|
|
716
|
+
cleanEnv['PROMPT'] = '$ ';
|
|
717
|
+
cleanEnv['TERM'] = 'dumb';
|
|
714
718
|
if (isWindows) {
|
|
715
719
|
proc = spawn(shell, [], {
|
|
716
720
|
cwd: ROOT_DIR,
|
|
@@ -719,18 +723,22 @@ function handleTerminalSpawn(payload) {
|
|
|
719
723
|
shell: true,
|
|
720
724
|
});
|
|
721
725
|
}
|
|
722
|
-
else if (os.platform() === 'darwin') {
|
|
723
|
-
// macOS: use script to create a PTY
|
|
724
|
-
// script -q /dev/null shell - creates PTY, logs to /dev/null, runs shell
|
|
725
|
-
proc = spawn('script', ['-q', '/dev/null', shell], {
|
|
726
|
-
cwd: ROOT_DIR,
|
|
727
|
-
env: cleanEnv,
|
|
728
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
726
|
else {
|
|
732
|
-
//
|
|
733
|
-
|
|
727
|
+
// Spawn shell with flags to disable rc files and work non-interactively
|
|
728
|
+
const shellName = path.basename(shell);
|
|
729
|
+
let args = [];
|
|
730
|
+
if (shellName === 'zsh') {
|
|
731
|
+
// -f: no rc files, -s: read from stdin
|
|
732
|
+
args = ['-f', '-s'];
|
|
733
|
+
}
|
|
734
|
+
else if (shellName === 'bash') {
|
|
735
|
+
// --norc --noprofile: no rc files, -s: read from stdin
|
|
736
|
+
args = ['--norc', '--noprofile', '-s'];
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
args = ['-s'];
|
|
740
|
+
}
|
|
741
|
+
proc = spawn(shell, args, {
|
|
734
742
|
cwd: ROOT_DIR,
|
|
735
743
|
env: cleanEnv,
|
|
736
744
|
stdio: ['pipe', 'pipe', 'pipe'],
|