You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a goroutine that just waits for the terminal to be resized, and then show the size of the new terminal. However, while SIGWINCH does get triggered, the size from GetMaxYX() never changes. Here is the application:
package main
import (
"os"
"os/signal"
"strconv"
"sync"
"syscall"
g "github.com/rthornton128/goncurses"
)
var wg sync.WaitGroup
func main() {
wg.Add(1)
resizeChannel := make(chan os.Signal)
signal.Notify(resizeChannel, syscall.SIGWINCH)
go onResize(resizeChannel)
wg.Wait()
}
func onResize(channel chan os.Signal) {
stdScr, _ := g.Init()
stdScr.ScrollOk(true)
g.NewLines(true)
for {
<-channel
g.StdScr().Clear()
y, x := g.StdScr().MaxYX()
g.StdScr().Println(strconv.Itoa(x) + ", " + strconv.Itoa(y))
g.StdScr().Refresh()
}
wg.Done()
}
The text was updated successfully, but these errors were encountered:
I have a goroutine that just waits for the terminal to be resized, and then show the size of the new terminal. However, while SIGWINCH does get triggered, the size from GetMaxYX() never changes. Here is the application:
The text was updated successfully, but these errors were encountered: