teapot-coding-agent 0.37.134 → 0.37.135

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.
@@ -32,6 +32,23 @@ function append(t, chunk) {
32
32
  if (t.buffer.length > BUFFER_BYTES)
33
33
  t.buffer = t.buffer.slice(-BUFFER_BYTES);
34
34
  }
35
+ /**
36
+ * The environment a pty child gets.
37
+ *
38
+ * It used to carry `COLUMNS=100`/`LINES=30`, frozen at spawn. ncurses honours those variables OVER the terminal's
39
+ * real size (`use_env(TRUE)` is its default), so a full-screen ncurses program — `nano` — ignored every resize while
40
+ * a non-ncurses pager (`less`) followed the ioctl and worked. That is exactly the report: "lessで高さ調整が効いてるけど
41
+ * nanoでは効いてません" (#172).
42
+ *
43
+ * The pty's size is authoritative and is applied with TIOCSWINSZ on attach and on every resize, so the environment must
44
+ * not carry a competing copy of it.
45
+ */
46
+ export function terminalEnv(base) {
47
+ const env = { ...base, TERM: "xterm-256color" };
48
+ delete env.COLUMNS;
49
+ delete env.LINES;
50
+ return env;
51
+ }
35
52
  export function createTerminal(agentId, workspace, title) {
36
53
  const live = [...terms.values()].filter((t) => t.agentId === agentId && !t.exited);
37
54
  if (live.length >= MAX_PER_AGENT) {
@@ -39,7 +56,7 @@ export function createTerminal(agentId, workspace, title) {
39
56
  }
40
57
  const shell = terminalShellFor(process.platform, process.env);
41
58
  const hasScript = process.platform !== "win32" && existsSync("/usr/bin/script");
42
- const env = { ...process.env, TERM: "xterm-256color", COLUMNS: "100", LINES: "30" };
59
+ const env = terminalEnv(process.env);
43
60
  const child = hasScript
44
61
  ? spawn("script", ["-qec", shell, "/dev/null"], { cwd: workspace, env, detached: true })
45
62
  : spawn(shell, [], { cwd: workspace, env: { ...env, TERM: "dumb" }, detached: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.37.134",
3
+ "version": "0.37.135",
4
4
  "description": "A lightweight, always-on multi-agent harness for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",