Skip to content

fix(registry): vim isatty via host_tty, sigprocmask decl, termios force-include#262

Merged
NathanFlurry merged 1 commit into
mainfrom
vim-terminal-fixes
Jul 3, 2026
Merged

fix(registry): vim isatty via host_tty, sigprocmask decl, termios force-include#262
NathanFlurry merged 1 commit into
mainfrom
vim-terminal-fixes

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member

Three fixes to the source-built vim's terminal handling:

  • isatty: bridge isatty to host_tty.isatty. wasi-libc's fdstat-based isatty rejects a PTY fd that carries seek/tell rights, so vim printed "Output is not to a terminal" and refused full-screen mode. Now vim enters full-screen and edits/writes files byte-exact over the shell PTY (validated via the just shell grandchild path).
  • sigprocmask (build-robustness, real CI blocker): force-include <signal.h> and declare sigprocmask in compat.h. A clean-checkout configure defines HAVE_SIGPROCMASK (posix_stubs.c implements it), but wasi signal.h declares no prototype, so os_unix.c failed with implicit-declaration on a fresh build. The prior build only linked by build-state luck.
  • termios force-include: pull <termios.h> in compat.h so TIOCGWINSZ/struct winsize are defined in every TU (os_unix.c's window-size query is #ifdef TIOCGWINSZ-gated).

Known limitation: under @xterm/headless the status line renders ~2 rows high (vim relies on default bottom-margin scroll behavior rather than emitting an explicit scroll region like the older hand-built binary did). File editing is byte-exact; needs verification in a real terminal.

@railway-app railway-app Bot temporarily deployed to secure-exec / secure-exec-pr-262 July 3, 2026 20:38 Destroyed
@railway-app

railway-app Bot commented Jul 3, 2026

Copy link
Copy Markdown

🚅 Environment secure-exec-pr-262 in rivet-frontend has no services deployed.


🚅 Deployed to the secure-exec-pr-262 environment in secure-exec

Service Status Web Updated (UTC)
secure-exec 😴 Sleeping (View Logs) Web Jul 3, 2026 at 8:48 pm

- isatty delegates to host_tty (PTY fd wrongly reported not-a-tty by wasi-libc)
- implement real termcap tgoto() so parameterized caps (cursor motion, scroll
  region) are emitted under HAVE_TGETENT instead of silently dropped
- declare sigprocmask + force-include termios so a clean configure build links
@railway-app railway-app Bot temporarily deployed to secure-exec / secure-exec-pr-262 July 3, 2026 21:25 Destroyed
@NathanFlurry NathanFlurry merged commit 7946266 into main Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant