Skip to content

Fix Linux/WSL build failure in tmux terminal raw-mode handling#20

Open
Simsalaba wants to merge 1 commit intoJuliusBrussee:mainfrom
Simsalaba:fix/linux-wsl-tmux-build
Open

Fix Linux/WSL build failure in tmux terminal raw-mode handling#20
Simsalaba wants to merge 1 commit intoJuliusBrussee:mainfrom
Simsalaba:fix/linux-wsl-tmux-build

Conversation

@Simsalaba
Copy link
Copy Markdown

Summary

This fixes a Linux/WSL build failure in internal/tmux/terminal.go.

The current implementation uses unix.TIOCGETA and unix.TIOCSETA, which are not available on GNU/Linux. As a result, cavekit-bin fails to build in Linux/WSL environments and cavekit team plus related subcommands remain unavailable.

This patch replaces the manual ioctl-based raw terminal handling with golang.org/x/term, which provides a cross-platform raw-mode implementation and preserves the intended behavior for callers.

Problem

On WSL/Linux, building CaveKit failed with errors like:

internal/tmux/terminal.go:11:53: undefined: unix.TIOCGETA
internal/tmux/terminal.go:27:47: undefined: unix.TIOCSETA
internal/tmux/terminal.go:37:38: undefined: unix.TIOCSETA

Change

replace manual raw terminal handling in internal/tmux/terminal.go
use golang.org/x/term.MakeRaw
use golang.org/x/term.Restore
add the required module dependency

Why this approach

Using x/term avoids platform-specific ioctl constants and is a cleaner cross-platform solution than maintaining separate low-level terminal implementations.

Tested

environment: WSL2 / Linux amd64
verified that the project builds after the change

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