Provide the platform input/signal stubs on wasip1/wasip2 - #1767
Open
calvinrp wants to merge 1 commit into
Open
Conversation
Building bubbletea v2 for GOOS=wasip1 (added in Go 1.21) fails with initInput, suspendSupported, suspendProcess, and listenForResize undefined: tty_unix.go and signals_unix.go are gated to an explicit Unix GOOS list, tty_windows.go/signals_windows.go to Windows, and the WASI platforms select nothing. WASI has no raw mode, no process groups (SIGTSTP), and no SIGWINCH, so the stubs pick the non-TTY input path, disable suspend, and complete resize listening immediately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, and thanks for maintaining Bubble Tea!
Since Go 1.21 added
GOOS=wasip1(WASI preview 1), building bubbletea (the v2 line) for the WASI platforms fails, because the per-platform files select nothing there:tty_unix.goandsignals_unix.goare gated to an explicit Unix GOOS list, andtty_windows.go/signals_windows.goto Windows. This breaks downstream users on wasip1 — for examplegh(github.com/cli/cli), which imports bubbletea via its accessible prompter.WASI preview 1/2 has no raw terminal mode, no process groups (so no SIGTSTP suspend), and no SIGWINCH. The natural behavior is the one Bubble Tea already supports for non-terminal input:
initInputsucceeds without opening a TTY, selecting the non-TTY (pipe) input pathsuspendSupported = falseand a no-opsuspendProcesslistenForResizecloses its done channel immediately (no resize events)Verified:
GOOS=wasip1 GOARCH=wasm go build .now succeeds🤖 Generated with Claude Code