aiterm-mcp 0.15.0 → 0.15.1
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/core.js +16 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -209,12 +209,27 @@ function resolveTmux(observe = true) {
|
|
|
209
209
|
}
|
|
210
210
|
ptyDependencyError(tmuxMissingMessage(), observe);
|
|
211
211
|
}
|
|
212
|
+
// tmux は locale が C/POSIX/未設定だと UTF-8 を扱えない: server は send-keys/paste のマルチバイト
|
|
213
|
+
// 入力を破壊し(文字消失・周辺バイトの並べ替えを実測)、client は format 出力のタブ等を "_" へ
|
|
214
|
+
// サニタイズする。GUI 起動の MCP client は LANG を持たないことが多く、その環境で立った tmux server は
|
|
215
|
+
// 以後すべての入力を壊すため、UTF-8 locale が確定しない場合だけ LC_CTYPE を明示注入する。
|
|
216
|
+
// 利用者が C/POSIX 以外を明示設定している場合はその選択を尊重して触らない。
|
|
217
|
+
export function tmuxSpawnEnv() {
|
|
218
|
+
const effective = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG || "";
|
|
219
|
+
// 素の "C"/"POSIX" だけを壊れた既定とみなす。"C.UTF-8" を含む charset 付きの明示設定は尊重する。
|
|
220
|
+
if (effective && !/^(C|POSIX)$/i.test(effective))
|
|
221
|
+
return undefined;
|
|
222
|
+
const env = { ...process.env, LC_CTYPE: process.platform === "darwin" ? "UTF-8" : "C.UTF-8" };
|
|
223
|
+
// LC_ALL は LC_CTYPE より優先されるため、C/POSIX の LC_ALL が残ると注入が無効になる
|
|
224
|
+
delete env.LC_ALL;
|
|
225
|
+
return env;
|
|
226
|
+
}
|
|
212
227
|
function tmuxCommandWithInput(observe, input, ...args) {
|
|
213
228
|
// maxBuffer は既定 1MiB。capture-pane(大きなスクロールバック)や多セッションの list-sessions で
|
|
214
229
|
// 頭打ちになり stdout が切れる/空になる。Python の subprocess.run は無制限だったので 64MiB へ広げる。
|
|
215
230
|
// Windows は同じ tmux を WSL 経由(-e でログインシェル非経由=$ 展開やクオート崩れを防ぐ)で叩く。
|
|
216
231
|
let r;
|
|
217
|
-
const spawnOpts = { encoding: "utf8", maxBuffer: 64 * 1024 * 1024, input };
|
|
232
|
+
const spawnOpts = { encoding: "utf8", maxBuffer: 64 * 1024 * 1024, input, env: tmuxSpawnEnv() };
|
|
218
233
|
if (isWin) {
|
|
219
234
|
ensureWinBridge(observe);
|
|
220
235
|
r = spawnSync("wsl.exe", ["-e", "tmux", "-S", SOCK, ...args], spawnOpts);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"mcpName": "io.github.kitepon-rgb/aiterm-mcp",
|
|
5
5
|
"description": "AI-driven persistent terminal as a local stdio MCP server (tmux-backed). Holds one local PTY; SSH and containers are just commands you send into it. Also launches interactive Claude/Codex/Grok/Composer agent TUIs in a persistent terminal. Token-reducing reads.",
|
|
6
6
|
"keywords": [
|