groove-dev 0.16.2 → 0.16.3
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/node_modules/@groove-dev/daemon/src/terminal-pty.js +27 -15
- package/node_modules/@groove-dev/gui/dist/assets/{index-DeXW9EFU.js → index-CFeltwTB.js} +20 -20
- package/node_modules/@groove-dev/gui/dist/index.html +1 -1
- package/node_modules/@groove-dev/gui/src/components/EditorTabs.jsx +2 -2
- package/node_modules/@groove-dev/gui/src/components/FileTree.jsx +18 -8
- package/package.json +1 -1
- package/packages/daemon/src/terminal-pty.js +27 -15
- package/packages/gui/dist/assets/{index-DeXW9EFU.js → index-CFeltwTB.js} +20 -20
- package/packages/gui/dist/index.html +1 -1
- package/packages/gui/src/components/EditorTabs.jsx +2 -2
- package/packages/gui/src/components/FileTree.jsx +18 -8
|
@@ -6,8 +6,8 @@ import { existsSync } from 'fs';
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Manages interactive shell sessions for the GUI terminal.
|
|
9
|
-
* Uses
|
|
10
|
-
*
|
|
9
|
+
* Uses the `script` command to allocate a real PTY (prompts, colors, line editing).
|
|
10
|
+
* No native modules required — works on macOS and Linux out of the box.
|
|
11
11
|
*/
|
|
12
12
|
export class TerminalManager {
|
|
13
13
|
constructor(daemon) {
|
|
@@ -24,18 +24,31 @@ export class TerminalManager {
|
|
|
24
24
|
const shell = this._detectShell();
|
|
25
25
|
const cwd = options.cwd || this.daemon.projectDir;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
// Use `script` to allocate a real PTY — gives us prompts, colors, and line editing.
|
|
28
|
+
// macOS: script -q /dev/null <shell>
|
|
29
|
+
// Linux: script -qfc "<shell>" /dev/null
|
|
30
|
+
let proc;
|
|
31
|
+
const env = {
|
|
32
|
+
...process.env,
|
|
33
|
+
TERM: 'xterm-256color',
|
|
34
|
+
COLORTERM: 'truecolor',
|
|
35
|
+
LANG: process.env.LANG || 'en_US.UTF-8',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (process.platform === 'darwin') {
|
|
39
|
+
proc = spawn('script', ['-q', '/dev/null', shell, '-l'], {
|
|
40
|
+
cwd,
|
|
41
|
+
env,
|
|
42
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
// Linux (util-linux script)
|
|
46
|
+
proc = spawn('script', ['-qfc', `${shell} -l`, '/dev/null'], {
|
|
47
|
+
cwd,
|
|
48
|
+
env,
|
|
49
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
39
52
|
|
|
40
53
|
const session = { proc, ws, id };
|
|
41
54
|
this.sessions.set(id, session);
|
|
@@ -116,7 +129,6 @@ export class TerminalManager {
|
|
|
116
129
|
}
|
|
117
130
|
|
|
118
131
|
_detectShell() {
|
|
119
|
-
// Prefer user's shell, fall back to common ones
|
|
120
132
|
if (process.env.SHELL && existsSync(process.env.SHELL)) {
|
|
121
133
|
return process.env.SHELL;
|
|
122
134
|
}
|