Skip to content

Commit

Permalink
fix: use generic type in tty_windows.go and signals_windows.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Jan 29, 2025
1 parent 3f4e3fc commit 423a0e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion signals_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package tea

// listenForResize is not available on windows because windows does not
// implement syscall.SIGWINCH.
func (p *Program) listenForResize(done chan struct{}) {
func (p *Program[T]) listenForResize(done chan struct{}) {
close(done)
}
6 changes: 3 additions & 3 deletions tty_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"golang.org/x/sys/windows"
)

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

// Save output screen buffer state and enable VT processing.
if f, ok := p.output.Writer().(term.File); ok && term.IsTerminal(f.Fd()) {
if f, ok := p.Output.(term.File); ok && term.IsTerminal(f.Fd()) {
p.ttyOutput = f
p.previousOutputState, err = term.GetState(f.Fd())
if err != nil {
Expand Down

0 comments on commit 423a0e4

Please sign in to comment.