Skip to content

Commit

Permalink
Merge pull request #43 from thaJeztah/deprecate_ErrInvalidState
Browse files Browse the repository at this point in the history
deprecate ErrInvalidState
  • Loading branch information
thaJeztah committed May 2, 2023
2 parents 2ff7073 + fddc34e commit 4793886
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion term.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
)

// ErrInvalidState is returned if the state of the terminal is invalid.
//
// Deprecated: ErrInvalidState is no longer used.
var ErrInvalidState = errors.New("Invalid terminal state")

// State represents the state of the terminal.
Expand Down Expand Up @@ -55,7 +57,7 @@ func IsTerminal(fd uintptr) bool {
// to a previous state.
func RestoreTerminal(fd uintptr, state *State) error {
if state == nil {
return ErrInvalidState
return errors.New("invalid terminal state")
}
return tcset(fd, &state.termios)
}
Expand Down

0 comments on commit 4793886

Please sign in to comment.