Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Windows support? #6

Open
Altiano opened this issue May 10, 2020 · 2 comments
Open

No Windows support? #6

Altiano opened this issue May 10, 2020 · 2 comments

Comments

@Altiano
Copy link

Altiano commented May 10, 2020

got this when installing on Windows 10

$ go get -u github.com/mitranim/gow
# github.com/mitranim/gow
..\..\..\go\src\github.com\mitranim\gow\gow.go:97:15: undefined: unix.Termios
..\..\..\go\src\github.com\mitranim\gow\gow.go:138:31: cannot use syscall.Stdin (type syscall.Handle) as type int in argument to makeTerminalRaw
..\..\..\go\src\github.com\mitranim\gow\gow.go:234:10: undefined: syscall.Kill
..\..\..\go\src\github.com\mitranim\gow\gow.go:239:10: undefined: syscall.SIGCHLD
..\..\..\go\src\github.com\mitranim\gow\gow.go:242:10: undefined: syscall.SIGWINCH
..\..\..\go\src\github.com\mitranim\gow\gow.go:271:7: undefined: syscall.Kill
..\..\..\go\src\github.com\mitranim\gow\gow.go:277:7: undefined: syscall.Kill
..\..\..\go\src\github.com\mitranim\gow\gow.go:291:7: undefined: syscall.Kill
..\..\..\go\src\github.com\mitranim\gow\gow.go:342:31: undefined: unix.Termios
..\..\..\go\src\github.com\mitranim\gow\gow.go:368:38: undefined: unix.Termios
..\..\..\go\src\github.com\mitranim\gow\gow.go:291:7: too many errors
@mitranim
Copy link
Owner

mitranim commented May 12, 2020

My apologies, gow is currently implemented only for Unix. The core feature, watching the files and rerunning a go command, could work on any OS. The reason for this limitation is the hotkeys feature. It's implemented by switching the terminal to "raw mode" which allows the foreground program (gow) to receive and interpret special control signals sent by hotkeys such as Ctrl+R, which would normally be intercepted and interpreted by the terminal emulator app. Switching to raw mode uses special Unix syscalls. This might be possible on Windows, but I never checked. My recommendation for working on Windows would be to use WSL (Windows subsystem for Linux), because go commands in general are Unix-biased and perform much slower without WSL. gow should also work under WSL.

If there was enough demand for pure Windows support, it would be possible to add. In the limit case, gow could be compiled for Windows without the hotkeys feature.

@mitranim
Copy link
Owner

mitranim commented Nov 3, 2020

Tested and it does work under WSL. That's my recommendation for working with Go anyway. Last time I checked, go commands performed much better with WSL than without it.

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

No branches or pull requests

2 participants