Skip to content

Commit 423a0e4

Browse files
committed
fix: use generic type in tty_windows.go and signals_windows.go
1 parent 3f4e3fc commit 423a0e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

signals_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ package tea
55

66
// listenForResize is not available on windows because windows does not
77
// implement syscall.SIGWINCH.
8-
func (p *Program) listenForResize(done chan struct{}) {
8+
func (p *Program[T]) listenForResize(done chan struct{}) {
99
close(done)
1010
}

tty_windows.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"golang.org/x/sys/windows"
1212
)
1313

14-
func (p *Program) initInput() (err error) {
14+
func (p *Program[T]) initInput() (err error) {
1515
// Save stdin state and enable VT input
1616
// We also need to enable VT
1717
// input here.
18-
if f, ok := p.input.(term.File); ok && term.IsTerminal(f.Fd()) {
18+
if f, ok := p.Input.(term.File); ok && term.IsTerminal(f.Fd()) {
1919
p.ttyInput = f
2020
p.previousTtyInputState, err = term.MakeRaw(p.ttyInput.Fd())
2121
if err != nil {
@@ -34,7 +34,7 @@ func (p *Program) initInput() (err error) {
3434
}
3535

3636
// Save output screen buffer state and enable VT processing.
37-
if f, ok := p.output.Writer().(term.File); ok && term.IsTerminal(f.Fd()) {
37+
if f, ok := p.Output.(term.File); ok && term.IsTerminal(f.Fd()) {
3838
p.ttyOutput = f
3939
p.previousOutputState, err = term.GetState(f.Fd())
4040
if err != nil {

0 commit comments

Comments
 (0)