Skip to content

term: allow compiling for js/wasm - #64

Open
thaJeztah wants to merge 1 commit into
moby:mainfrom
thaJeztah:webassembly_stubs
Open

thaJeztah wants to merge 1 commit into
moby:mainfrom
thaJeztah:webassembly_stubs

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Add a platform-specific implementation to allow the module to compile for GOOS=js and GOARCH=wasm, without providing terminal functionality.

Terminal detection reports false, and unsupported operations return errors instead of silently succeeding. This is particularly important for operations such as disabling terminal echo, where silently ignoring the request could expose sensitive input.

Actual WebAssembly terminal support can be considered separately.

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The platform guards and stubs match the compilation-only scope and explicitly reject unsupported terminal operations.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@thaJeztah
thaJeztah requested a review from vvoland October 19, 2026 19:08
@thaJeztah
thaJeztah force-pushed the webassembly_stubs branch 3 times, most recently from 14691a5 to cffc379 Compare October 19, 2026 20:19
@thaJeztah
thaJeztah requested a balanced review from Copilot October 19, 2026 20:19

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The build constraints and stubs consistently provide compile-only support without silently accepting unsupported terminal operations.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@thaJeztah

Copy link
Copy Markdown
Member Author

cc @vvoland ptal

@thaJeztah

Copy link
Copy Markdown
Member Author

Had a quick peek at golang.org/x/term (parts of which we may want to wrap in future instead of golang.org/x/sys directly); I'll make some minor changes (naming of the stub files, error-message) to align with it, so that a future rewrite using golang.org/x/term will be less eventful.

Add a platform-specific implementation to allow the module to compile
for GOOS=js and GOARCH=wasm, without providing terminal functionality.

Terminal detection reports false, and unsupported operations return
errors instead of silently succeeding. This is particularly important
for operations such as disabling terminal echo, where silently ignoring
the request could expose sensitive input.

Actual WebAssembly terminal support can be considered separately.

Signed-off-by: Rémy Léone <rleone@scaleway.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
Member Author

Done (for now)

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.

3 participants