//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || aix
// +build darwin dragonfly freebsd linux netbsd openbsd solaris aix

package uv

import (
	
	
)

func (,  term.File) (,  *term.State,  error) {
	if  == nil &&  == nil {
		return nil, nil, ErrNotTerminal
	}

	// Check if we have a terminal.
	for ,  := range []term.File{, } {
		if  == nil {
			continue
		}
		,  = term.MakeRaw(.Fd())
		if  == nil {
			break
		}
	}

	if  != nil {
		return nil, nil,  //nolint:wrapcheck
	}

	return , , nil
}

func (,  term.File) ( Winsize,  error) {
	// Try both inTty and outTty to get the size.
	 = ErrNotTerminal
	for ,  := range []term.File{, } {
		if  == nil {
			continue
		}
		,  := termios.GetWinsize(int(.Fd()))
		if  == nil {
			return Winsize(*), nil
		}
	}
	return
}

func (,  term.File) (,  int,  error) {
	,  := getWinsize(, )
	return int(.Col), int(.Row), 
}

func ( *term.State) (,  bool) {
	return supportsHardTabs(uint64(.Oflag)), supportsBackspace(uint64(.Lflag)) //nolint:unconvert,nolintlint
}