Skip to content

Commit

Permalink
Merge branch 'golang:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
qxxt committed Jun 26, 2023
2 parents d08250c + f6de4a1 commit 39cb14d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 18 deletions.
3 changes: 0 additions & 3 deletions AUTHORS

This file was deleted.

3 changes: 0 additions & 3 deletions CONTRIBUTORS

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module golang.org/x/term

go 1.17

require golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
require golang.org/x/sys v0.9.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10 changes: 5 additions & 5 deletions term.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//
// Putting a terminal into raw mode is the most common requirement:
//
// oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
// if err != nil {
// panic(err)
// }
// defer term.Restore(int(os.Stdin.Fd()), oldState)
// oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
// if err != nil {
// panic(err)
// }
// defer term.Restore(int(os.Stdin.Fd()), oldState)
//
// Note that on non-Unix systems os.Stdin.Fd() may not be 0.
package term
Expand Down
3 changes: 1 addition & 2 deletions term_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package term_test

import (
"io/ioutil"
"os"
"runtime"
"testing"
Expand All @@ -14,7 +13,7 @@ import (
)

func TestIsTerminalTempFile(t *testing.T) {
file, err := ioutil.TempFile("", "TestIsTerminalTempFile")
file, err := os.CreateTemp("", "TestIsTerminalTempFile")
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ func (t *Terminal) queue(data []rune) {
t.outBuf = append(t.outBuf, []byte(string(data))...)
}

var eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'}
var space = []rune{' '}

func isPrintable(key rune) bool {
Expand Down Expand Up @@ -935,7 +934,7 @@ func (s *stRingBuffer) Add(a string) {
// next most recent, and so on. If such an element doesn't exist then ok is
// false.
func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {
if n >= s.size {
if n < 0 || n >= s.size {
return "", false
}
index := s.head - n
Expand Down

0 comments on commit 39cb14d

Please sign in to comment.