pi-web-ui 0.2.11 → 0.2.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/bin/pi-web-ui.mjs +6 -0
- package/dist/server/terminals.js +14 -1
- package/package.json +1 -1
package/bin/pi-web-ui.mjs
CHANGED
|
@@ -420,6 +420,12 @@ function serviceEnv(port, cwd, dataDir) {
|
|
|
420
420
|
// Interactive Windows tasks inherit the user's PATH; only systemd/launchd
|
|
421
421
|
// run with a minimal environment that needs an explicit PATH.
|
|
422
422
|
if (!isWin) env.PATH = process.env.PATH ?? "/usr/local/bin:/usr/bin:/bin";
|
|
423
|
+
// Same for the locale: launchd/systemd drop LANG/LC_ALL, and a C-locale
|
|
424
|
+
// shell garbles multibyte input in the terminal (UTF-8 continuation
|
|
425
|
+
// bytes 0x80–0x9F rendered as C1 control chars). Bake the installing
|
|
426
|
+
// shell's locale into the service env so spawned terminals are UTF-8.
|
|
427
|
+
if (!isWin && process.env.LANG) env.LANG = process.env.LANG;
|
|
428
|
+
if (!isWin && process.env.LC_ALL) env.LC_ALL = process.env.LC_ALL;
|
|
423
429
|
if (dataDir) env.PI_WEB_DATA_DIR = dataDir;
|
|
424
430
|
return env;
|
|
425
431
|
}
|
package/dist/server/terminals.js
CHANGED
|
@@ -113,6 +113,19 @@ const SHELL = isWindows
|
|
|
113
113
|
: process.env.SHELL || "bash";
|
|
114
114
|
/** `-i` is POSIX-only; cmd.exe / powershell.exe start interactively on their own. */
|
|
115
115
|
const SHELL_ARGS = isWindows ? [] : ["-i"];
|
|
116
|
+
/**
|
|
117
|
+
* Environment for spawned shells. System services (launchd/systemd) run with
|
|
118
|
+
* no locale variables, which puts the shell in the C locale: its line editor
|
|
119
|
+
* then renders UTF-8 continuation bytes 0x80–0x9F as C1 control characters
|
|
120
|
+
* (e.g. `�<0091><0098>` for 员), garbling Chinese input in the terminal.
|
|
121
|
+
* Default a UTF-8 locale so multibyte text round-trips.
|
|
122
|
+
*/
|
|
123
|
+
function shellEnv() {
|
|
124
|
+
const env = { ...process.env, TERM: "xterm-256color" };
|
|
125
|
+
if (!env.LANG && !env.LC_ALL)
|
|
126
|
+
env.LANG = "en_US.UTF-8";
|
|
127
|
+
return env;
|
|
128
|
+
}
|
|
116
129
|
// ---------------------------------------------------------------------------
|
|
117
130
|
// spawn-helper permission repair (node-pty macOS prebuilds)
|
|
118
131
|
// ---------------------------------------------------------------------------
|
|
@@ -252,7 +265,7 @@ export class TerminalManager {
|
|
|
252
265
|
cols: Math.max(2, Math.floor(cols) || 80),
|
|
253
266
|
rows: Math.max(2, Math.floor(rows) || 24),
|
|
254
267
|
cwd: abs,
|
|
255
|
-
env:
|
|
268
|
+
env: shellEnv(),
|
|
256
269
|
});
|
|
257
270
|
}
|
|
258
271
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-web-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Web chat interface for the pi coding agent, powered by the pi SDK (@earendil-works/pi-coding-agent) — one-command run, Docker/systemd/launchd deployable",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|