7 Commits

Author SHA1 Message Date
Dmitri Shuralyov
6a610bc55b all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

For golang/go#60268.

Change-Id: Ic6a53c8e217966f5f95b3a968b25ef123b4b99cf
Reviewed-on: https://go-review.googlesource.com/c/term/+/534475
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-10-11 14:06:51 +00:00
qxxt
88fcf87c53 term: consistently return zeroes on GetSize error
All other platform have return value of 0 for error when trying to get
the terminal size while unix have -1. That makes it hard to catch
whether the value passed from it was inserted on purpose.

Change-Id: If47d07bd2d4f6cd439ad0ff4958e4095c8e4df9d
GitHub-Last-Rev: 39cb14de33
GitHub-Pull-Request: golang/term#6
Reviewed-on: https://go-review.googlesource.com/c/term/+/506235
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-07-04 21:01:22 +00:00
Tobias Klauser
72f3dc4e9b term: use existing unix implementation on solaris
All other unix platforms use the same implementation in term_unix.go.
The existing implementation in term_solaris.go is equivalent, so
use the common implementation on solaris as well.

Change-Id: Ie4f67fd3508bea54772c4422ff1dcf73ba76d985
Reviewed-on: https://go-review.googlesource.com/c/term/+/307669
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-04-06 21:00:42 +00:00
Russ Cox
6a3ed077a4 all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: I39a1884031dd02279530c64cd5d65ddfb8ba299c
Reviewed-on: https://go-review.googlesource.com/c/term/+/294422
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-02-20 03:29:56 +00:00
Filippo Valsorda
f5c789dd32 all: apply golang.org/wiki/TargetSpecific
Also removed the obsolete appengine tag, switched _unsupported.go to
negative tags, so that out-of-tree GOOSes compile out of the box,
reduced use of build tags to reduce confusion, and renamed files that
extend _unix.go to _unix_GOOS.go.

Updates #31044

Change-Id: Ifb6f14c99713bb6a9edff630f90e9beffff3ed02
Reviewed-on: https://go-review.googlesource.com/c/term/+/258002
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Andrea Barisani <lcars.net@gmail.com>
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
2020-11-17 13:21:31 +00:00
Filippo Valsorda
d7a72108b8 all: import golang.org/x/crypto/ssh/terminal
This merges all code from x/crypto/ssh/terminal at commit
0c6587e931a935f573efb6988c8470cd8c0a58de with no refactoring,
simply mapping util_* files to term_*.

The x/crypto history for the merge was rewritten with

    git filter-repo --path ssh/terminal/ --path-rename ssh/terminal/:

and then stitched together with "git replace --graft".

The merge preserves git blame visibility.

Updates #31044

Change-Id: Ic51fc8ec20b3a384cdd8868fde06fe69b6317695
2020-11-14 00:47:01 +01:00
Tobias Klauser
c3296ef303 term: add IsTerminal function
Extracted from golang.org/x/crypto/ssh/terminal

The implementation for plan9 is based on IsTerminal from
github.com/mattn/go-isatty

Change-Id: Id7bf2d6595639ff08e5fd5f786a145d340bbed08
Reviewed-on: https://go-review.googlesource.com/c/term/+/200681
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-14 20:34:36 +00:00