mirror of
https://github.com/golang/term.git
synced 2026-02-09 04:06:04 +03:00
Compare commits
8 Commits
internal-b
...
v0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a66f970e0 | ||
|
|
a9ba230a40 | ||
|
|
065cf7ba24 | ||
|
|
e5f449aeb1 | ||
|
|
03fcf44c22 | ||
|
|
f766a8b9ae | ||
|
|
140adaaadf | ||
|
|
6886f2dfbf |
3
AUTHORS
3
AUTHORS
@@ -1,3 +0,0 @@
|
||||
# This source code refers to The Go Authors for copyright purposes.
|
||||
# The master list of authors is in the main Go distribution,
|
||||
# visible at http://tip.golang.org/AUTHORS.
|
||||
@@ -1,3 +0,0 @@
|
||||
# This source code was written by the Go contributors.
|
||||
# The master list of contributors is in the main Go distribution,
|
||||
# visible at http://tip.golang.org/CONTRIBUTORS.
|
||||
1
codereview.cfg
Normal file
1
codereview.cfg
Normal file
@@ -0,0 +1 @@
|
||||
issuerepo: golang/go
|
||||
2
go.mod
2
go.mod
@@ -2,4 +2,4 @@ module golang.org/x/term
|
||||
|
||||
go 1.17
|
||||
|
||||
require golang.org/x/sys v0.0.0-20201119102817-f84b799fce68
|
||||
require golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
|
||||
|
||||
4
go.sum
4
go.sum
@@ -1,2 +1,2 @@
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
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=
|
||||
|
||||
12
term.go
12
term.go
@@ -7,11 +7,13 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
// State contains the state of a terminal.
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
package term_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -935,7 +935,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
|
||||
|
||||
@@ -407,7 +407,7 @@ func TestMakeRawState(t *testing.T) {
|
||||
t.Fatalf("failed to get terminal state from GetState: %s", err)
|
||||
}
|
||||
|
||||
if runtime.GOOS == "ios" || (runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")) {
|
||||
if runtime.GOOS == "ios" {
|
||||
t.Skip("MakeRaw not allowed on iOS; skipping test")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user