Example #1
0
func monitorTerminal(stdOutFD uintptr) {
	sigs := make(chan os.Signal, 1)

	signal.Notify(sigs, syscall.SIGWINCH)
	defer signal.Stop(sigs)

	// inform the server what the starting size is
	resizeTTY(terminal.GetTTYSize(stdOutFD))

	for range sigs {
		resizeTTY(terminal.GetTTYSize(stdOutFD))
	}
}
Example #2
0
func monitorTerminal(stdOutFD uintptr, params string) {
	sigs := make(chan os.Signal, 1)
	signal.Notify(sigs, syscall.SIGWINCH)
	defer signal.Stop(sigs)
	for range sigs {
		w, h := terminal.GetTTYSize(stdOutFD)
		resizeTTY(stdOutFD, params, w, h)
	}
}
Example #3
0
func monitorTerminal(stdOutFD uintptr, params string) {
	tick := time.Tick(time.Millisecond * 250)

	//
	prevW, prevH := terminal.GetTTYSize(stdOutFD)
	for {
		select {
		case <-tick:
			w, h := terminal.GetTTYSize(stdOutFD)

			if prevW != w || prevH != h {
				resizeTTY(stdOutFD, params, w, h)
			}

			prevW, prevH = w, h
		}
	}
}
Example #4
0
func monitorTerminal(stdOutFD uintptr) {
	tick := time.Tick(time.Millisecond * 250)

	//
	prevW, prevH := terminal.GetTTYSize(stdOutFD)
	// inform the server what the starting size is
	resizeTTY(prevW, prevH)

	for {
		select {
		case <-tick:
			w, h := terminal.GetTTYSize(stdOutFD)

			if prevW != w || prevH != h {
				resizeTTY(w, h)
			}

			prevW, prevH = w, h
		}
	}
}