MrMarble/termsvg

Building on Windows fails, and there are no Windows bins in `/releases`

brian6932 opened this issue · 2 comments

❯ go install github.com/mrmarble/termsvg/cmd/termsvg@latest
go: downloading github.com/mrmarble/termsvg v0.6.1
go: downloading github.com/alecthomas/kong v0.4.1
go: downloading github.com/hinshun/vt10x v0.0.0-20220301184237-5011da428d02
go: downloading github.com/creack/pty v1.1.17
go: downloading github.com/rs/zerolog v1.26.1
go: downloading github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading github.com/tdewolff/minify/v2 v2.10.0
go: downloading golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
go: downloading github.com/tdewolff/parse/v2 v2.5.27
# github.com/mrmarble/termsvg/cmd/termsvg/rec
..\..\..\..\go\pkg\mod\github.com\mrmarble\termsvg@v0.6.1\cmd\termsvg\rec\rec.go:76:19: undefined: pty.Start
..\..\..\..\go\pkg\mod\github.com\mrmarble\termsvg@v0.6.1\cmd\termsvg\rec\rec.go:143:28: undefined: syscall.SIGWINCH
..\..\..\..\go\pkg\mod\github.com\mrmarble\termsvg@v0.6.1\cmd\termsvg\rec\rec.go:152:16: undefined: syscall.SIGWINCH

Since SIGWINCH doesn't work on Windows. Imo, either a build without rec, should be made for Windows, or a WINDOW_BUFFER_SIZE_EVENT way of getting the info should be added.

Patch file for anyone wanting to build on Windows:

diff --git a/cmd/termsvg/main.go b/cmd/termsvg/main.go
index 9a60539..1a30b21 100644
--- a/cmd/termsvg/main.go
+++ b/cmd/termsvg/main.go
@@ -7,7 +7,6 @@ import (
 	"github.com/alecthomas/kong"
 	"github.com/mrmarble/termsvg/cmd/termsvg/export"
 	"github.com/mrmarble/termsvg/cmd/termsvg/play"
-	"github.com/mrmarble/termsvg/cmd/termsvg/rec"
 	"github.com/rs/zerolog"
 	"github.com/rs/zerolog/log"
 )
@@ -46,13 +45,12 @@ func main() {
 		Version VersionFlag `name:"version" help:"Print version information and quit"`
 
 		Play   play.Cmd   `cmd:"" help:"Play a recording."`
-		Rec    rec.Cmd    `cmd:"" help:"Record a terminal sesion."`
 		Export export.Cmd `cmd:"" help:"Export asciicast."`
 	}
 
 	ctx := kong.Parse(&cli,
 		kong.Name("termsvg"),
-		kong.Description("A cli tool for recording terminal sessions"),
+		kong.Description("A cli tool for recording terminal sessions (recording, doesn't currently work on Windows)"),
 		kong.UsageOnError())
 	// Call the Run() method of the selected parsed command.
 	err := ctx.Run(&Context{Debug: cli.Debug})