Restore EOL conversion to fix indented output

This commit is contained in:
blamouche 2026-03-13 23:47:46 +01:00
parent 9ca10cb378
commit 84ea45a951
7 changed files with 24 additions and 4 deletions

View file

@ -7,6 +7,6 @@
- In this Obsidian embedded context, `script` fallback can fail with `tcgetattr/ioctl`; keep shell-based launch specs for Codex in the Python PTY bridge and surface explicit errors if no TTY path works.
- Proactive terminal handshake injection can be echoed back as raw input in bridge mode; prefer startup-config mitigations over escape-sequence injection.
- If injected terminal response sequences are echoed as raw text, stop injection and instead disable Codex startup prompts/warnings via config flags to reduce hidden interactive blockers.
- For interactive Codex/TUI output in embedded xterm, avoid forcing `convertEol: true`; it can distort line rendering and split characters across lines.
- Keep xterm `convertEol: true` for mixed CLI streams that emit `\\n` without `\\r`; disabling it causes cumulative horizontal indentation.
- Python PTY bridge must set terminal size explicitly (`TIOCSWINSZ`) using requested cols/rows; otherwise interactive TUI output can degrade into letter-per-line rendering.
- Before writing plugin system notices in terminal, clear the current line (`\\r` + `ESC[2K`) to avoid appending logs onto an active TUI status line.

View file

@ -30,3 +30,4 @@
| 2026-03-13 23:30:56 CET | agent | Fixed broken split-character Codex rendering by disabling forced xterm EOL conversion (`convertEol: false`); validated build/tests and updated governance files. | `main.ts`, `.prompt-hub/lessons.md`, `npm run build`, `npm test`, `.prompt-hub/todo/todo-20260313-233016-fix-codex-split-characters-output.md`, `.prompt-hub/version.md`, `.prompt-hub/releases.md` | success | Commit and push for user verification. |
| 2026-03-13 23:37:35 CET | agent | Fixed letter-per-line Codex output by propagating cols/rows to python PTY bridge and applying `TIOCSWINSZ` in explicit PTY fork/exec bridge path; validated compile/smoke/build/tests. | `pty-proxy.js`, `pty-bridge.py`, `.prompt-hub/lessons.md`, `python3 -m py_compile pty-bridge.py`, `python3 pty-bridge.py <payload>`, `npm run build`, `npm test`, `.prompt-hub/todo/todo-20260313-233621-fix-codex-pty-size-python-bridge.md`, `.prompt-hub/version.md`, `.prompt-hub/releases.md` | success | Commit and push for user retest. |
| 2026-03-13 23:41:40 CET | agent | Fixed mixed-line terminal logs by clearing active line before plugin system messages and routing lifecycle notices through helper; validated build/tests. | `main.ts`, `.prompt-hub/lessons.md`, `npm run build`, `npm test`, `.prompt-hub/todo/todo-20260313-234041-clean-system-log-lines-in-terminal.md`, `.prompt-hub/version.md`, `.prompt-hub/releases.md` | success | Commit and push for user verification. |
| 2026-03-13 23:47:41 CET | agent | Fixed indented terminal formatting by restoring xterm `convertEol: true` after PTY-size bridge fix; validated build/tests and updated governance files. | `main.ts`, `.prompt-hub/lessons.md`, `npm run build`, `npm test`, `.prompt-hub/todo/todo-20260313-234655-fix-indented-output-after-pty-size-fix.md`, `.prompt-hub/version.md`, `.prompt-hub/releases.md` | success | Commit and push for user verification. |

View file

@ -1,5 +1,8 @@
# Releases
## 0.1.14 - 2026-03-13
- Fixed cumulative indentation/misaligned output by restoring xterm EOL conversion (`convertEol: true`) for mixed CLI streams that emit LF-only line endings.
## 0.1.13 - 2026-03-13
- Added terminal-safe plugin logging helper that clears the active line before printing system messages, preventing `Runtime selected` / `Starting` notices from being appended to active Codex status lines.

View file

@ -0,0 +1,16 @@
# Task: Fix indented terminal output formatting
## Context
- Output lines are increasingly indented/misaligned in embedded terminal after recent changes.
- Root cause: xterm `convertEol=false` keeps cursor column on `\n`-only lines.
## Plan
- [x] Restore xterm `convertEol: true`.
- [x] Validate build/tests.
- [x] Update traceability artifacts and push.
## Review
- Restored xterm `convertEol: true` so lines ending with `\\n` reset correctly to column 0 in embedded output streams.
- Validation:
- `npm run build` passed.
- `npm test` passed (`12/12` tests).

View file

@ -1 +1 @@
0.1.13
0.1.14

View file

@ -9416,7 +9416,7 @@ var ClaudeCliView = class extends import_obsidian.ItemView {
this.terminalHostEl = this.contentEl.createDiv({ cls: "claude-cli-terminal" });
this.terminal = new Dl({
cursorBlink: true,
convertEol: false,
convertEol: true,
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",
fontSize: 13,
scrollback: 3e3,

View file

@ -92,7 +92,7 @@ class ClaudeCliView extends ItemView {
this.terminal = new Terminal({
cursorBlink: true,
convertEol: false,
convertEol: true,
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",
fontSize: 13,
scrollback: 3000,