Files
coder/cli/ssh_windows.go
Kyle Carberry 885d5f2098 fix: Monitor TTY size when using SSH (#1119)
The TTY wasn't resizing properly, and reasonably so considering
we weren't updating it 🤦.
2022-04-24 22:23:54 -05:00

28 lines
392 B
Go

//go:build windows
// +build windows
package cli
import (
"context"
"os"
"time"
)
func listenWindowSize(ctx context.Context) <-chan os.Signal {
windowSize := make(chan os.Signal, 3)
ticker := time.NewTicker(time.Second)
go func() {
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
}
windowSize <- nil
}
}()
return windowSize
}