test-case: vim works inside aish (interactive PTY) #16

Closed
opened 2026-05-10 21:37:59 +00:00 by claude-noether · 1 comment
Collaborator

Steps

  1. cd ~/src/aish && luajit main.lua
  2. At the prompt: $vim /tmp/aish-pty-test.txt (the $ prefix force-routes to shell)
  3. vim renders. Type i (just the letter, no Enter) to enter insert mode.
  4. Type: Hello from vim followed by Esc.
  5. Type :wq then Enter.
  6. After aish prompt returns, run: $cat /tmp/aish-pty-test.txt

Expected

  • vim opens with normal full-screen rendering, status line at bottom.
  • Pressing i enters insert mode without needing Enter (= raw mode is active).
  • :wq writes the file and quits.
  • aish prompt returns; closing rule shows ─── exit 0 ───.
  • cat prints Hello from vim.

What this exercises

Phase 1 §1 done-criteria #2 (PTY-backed exec works for interactive cmds).
Specifically: forkpty, stdin→master forwarding, parent tty raw mode toggle, child line discipline.

Likely failure modes

  • Single-key (i, :wq) doesn't take effect → raw-mode toggle broken.
  • Terminal stays "sticky" after vim quits (echo off, no line input) → restore_termios missed.
  • Input goes to aish instead of vim → stdin forwarding broken.
## Steps 1. `cd ~/src/aish && luajit main.lua` 2. At the prompt: `$vim /tmp/aish-pty-test.txt` *(the `$` prefix force-routes to shell)* 3. vim renders. Type `i` (just the letter, no Enter) to enter insert mode. 4. Type: `Hello from vim` followed by Esc. 5. Type `:wq` then Enter. 6. After aish prompt returns, run: `$cat /tmp/aish-pty-test.txt` ## Expected - vim opens with normal full-screen rendering, status line at bottom. - Pressing `i` enters insert mode **without needing Enter** (= raw mode is active). - `:wq` writes the file and quits. - aish prompt returns; closing rule shows `─── exit 0 ───`. - `cat` prints `Hello from vim`. ## What this exercises Phase 1 §1 done-criteria #2 (PTY-backed exec works for interactive cmds). Specifically: `forkpty`, stdin→master forwarding, parent tty raw mode toggle, child line discipline. ## Likely failure modes - Single-key (`i`, `:wq`) doesn't take effect → raw-mode toggle broken. - Terminal stays "sticky" after vim quits (echo off, no line input) → `restore_termios` missed. - Input goes to aish instead of vim → stdin forwarding broken.
claude-noether added the test-case label 2026-05-10 21:37:59 +00:00
Owner

[aish:fast]> $cat /tmp/aish-pty-test.txt
─── exec output ───
Hello from vim
─── exit 0 ───
[aish:fast]>

executed succesfully.

[aish:fast]> $cat /tmp/aish-pty-test.txt ─── exec output ─── Hello from vim ─── exit 0 ─── [aish:fast]> executed succesfully.
Sign in to join this conversation.