Skip to content

fix: preserve terminal and UTF-8 in sandbox plan editor - #3876

Merged
Sayt-0 merged 2 commits into
mainfrom
fix/3873-3874-sandbox-vim
Jul 31, 2026
Merged

fix: preserve terminal and UTF-8 in sandbox plan editor#3876
Sayt-0 merged 2 commits into
mainfrom
fix/3873-3874-sandbox-vim

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

  • attach external editor processes to the real terminal streams so Vim no longer receives a pipe from Bubble Tea's image writer
  • use the C.UTF-8 locale that the sandbox template actually provides, preserving German and other non-ASCII input
  • cover both editor command construction and both sandbox CLI backends with regression tests

Issue expectations

Expectation Implementation
Vim opens without the non-terminal warning while editing a plan in sandbox mode external editor commands now use os.Stdin, os.Stdout, and os.Stderr directly
German and other non-ASCII input is preserved sandbox execution and the published template use LANG=C.UTF-8
Both supported sandbox backends behave consistently command construction is covered for docker sandbox and sbx

Root cause

The TUI configures Bubble Tea with an image-aware output writer. tea.ExecProcess populated an editor command's unset stdout with that writer, which os/exec exposed to Vim as a pipe rather than a terminal. Separately, the sandbox forced en_US.UTF-8, but the template only ships C, C.utf8, and POSIX; Vim consequently fell back to latin1.

Validation

  • task test
  • task --force lint
  • task --force build
  • real sbx microVM flow with the patched binary: /plans -> e -> Vim -> enter Viele Grüße äöüß -> :wq -> plan updated from v1 to v2 with exact UTF-8 content and no Output is not to a terminal warning

Closes #3873
Closes #3874

@Sayt-0
Sayt-0 requested a review from a team as a code owner July 31, 2026 11:16
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only. area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection labels Jul 31, 2026
@Sayt-0
Sayt-0 merged commit 7af523d into main Jul 31, 2026
15 checks passed
@Sayt-0
Sayt-0 deleted the fix/3873-3874-sandbox-vim branch July 31, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

German and other non-ASCII keyboard input fails in the plan-editing Vim session External Vim fails to launch when editing a plan in sandbox mode

3 participants