Commit Graph

107 Commits

Author SHA1 Message Date
Gopher Robot
ee66497fa3 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I1ea17696accca38de639a9ac8bd16835049054e6
Reviewed-on: https://go-review.googlesource.com/c/term/+/545096
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
v0.15.0
2023-11-27 15:36:23 +00:00
Gopher Robot
70d3a0bd3f go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I4cd3651aa5aee0f23057b34766331dccecce6cb8
Reviewed-on: https://go-review.googlesource.com/c/term/+/540518
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
v0.14.0
2023-11-07 19:02:24 +00:00
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
Gopher Robot
ea6303ae75 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I1e06b47cc115e1d4a41c210f650f3bb0f017777a
Reviewed-on: https://go-review.googlesource.com/c/term/+/532935
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
v0.13.0
2023-10-05 14:06:51 +00:00
Gopher Robot
f413282cd8 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I51aff871b155c803eb1c220dd9c2a6d94e87f281
Reviewed-on: https://go-review.googlesource.com/c/term/+/525295
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
v0.12.0
2023-09-03 13:08:59 +00:00
Gopher Robot
19e73c2b80 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: I9bde40dbd96354e25a486aeb47cfe0f940a958cd
Reviewed-on: https://go-review.googlesource.com/c/term/+/515975
Auto-Submit: Gopher Robot <gobot@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
v0.11.0
2023-08-04 15:09:51 +00:00
Gopher Robot
edd9fb7f4a go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: Ifd1732a667fa67f0ee1e06c6a8afb7fc7d71f54f
Reviewed-on: https://go-review.googlesource.com/c/term/+/507835
Run-TryBot: Gopher Robot <gobot@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
v0.10.0
2023-07-05 12:29:46 +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
Gopher Robot
f6de4a13df go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: Ib68756ce1a8aef7c99ff86e6c71a72794886de0e
Reviewed-on: https://go-review.googlesource.com/c/term/+/502517
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
v0.9.0
2023-06-12 17:38:33 +00:00
Gopher Robot
119f703398 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: Ifa4538c7af7df94781ea945b6d36be4a32189059
Reviewed-on: https://go-review.googlesource.com/c/term/+/492636
Auto-Submit: Gopher Robot <gobot@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
v0.8.0
2023-05-04 15:43:54 +00:00
Gopher Robot
7ae6be6d01 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: Ie69ca3795a34ff6a73adf2c85bccae17aca4ee38
Reviewed-on: https://go-review.googlesource.com/c/term/+/482135
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
v0.7.0
2023-04-04 18:21:21 +00:00
Gopher Robot
0edf009663 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: I693f904964c4c6d4920034a424a9f3e95825a268
Reviewed-on: https://go-review.googlesource.com/c/term/+/473435
Auto-Submit: Gopher Robot <gobot@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
v0.6.0
2023-03-05 01:20:54 +00:00
Gopher Robot
d974fe8326 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: If1fff921b9cedf43c4ab936934e16ed304777a63
Reviewed-on: https://go-review.googlesource.com/c/term/+/465915
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
v0.5.0
2023-02-07 17:11:03 +00:00
Gopher Robot
1efcd90d86 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: I3ff1efa287de001f5b080fc389a03231a6102ce3
Reviewed-on: https://go-review.googlesource.com/c/term/+/460496
Run-TryBot: Gopher Robot <gobot@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
v0.4.0
2023-01-04 15:40:46 +00:00
Gopher Robot
97ca0e3821 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: I3c770ec1f36cd379ef7400445cf05e32afb1e109
Reviewed-on: https://go-review.googlesource.com/c/term/+/455296
Run-TryBot: Gopher Robot <gobot@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
v0.3.0
2022-12-05 21:31:52 +00:00
Gopher Robot
f72a2d8d64 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: I881b6b77e89e8d521940c996e893be72632b4867
Reviewed-on: https://go-review.googlesource.com/c/term/+/448456
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Gopher Robot <gobot@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
v0.2.0
2022-11-07 19:53:28 +00:00
M. J. Fromberger
f6f2839df8 term: remove unused variable
The eraseUnderCursor variable is unused, it came in with the import
of the x/crypto/ssh/terminal package at d7a7210 but is not referenced
here.

When this package is vendored, the unused unexported name trips warnings
from tools like staticcheck.

Change-Id: I4289239edcdfec434ec26b164ae6c0a9b9ee7067
GitHub-Last-Rev: a4ab5868b4
GitHub-Pull-Request: golang/term#10
Reviewed-on: https://go-review.googlesource.com/c/term/+/446455
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-11-02 18:10:37 +00:00
Gopher Robot
8365914569 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.
Once this CL is submitted, and post-submit testing succeeds on all
first-class ports across all supported Go versions, this repository
will be tagged with its next minor version.

Change-Id: I481d3392e3d112911300c7bcf9411df0c6b73bd6
Reviewed-on: https://go-review.googlesource.com/c/term/+/443415
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
2022-10-17 18:49:19 +00:00
cui fliter
7a66f970e0 term_test.go: replace io/ioutil with io and os package
For golang/go#45557

Change-Id: I27cfebf64dd4597e3f00ea3fbb32d670619b5c45
GitHub-Last-Rev: 4c4433c530
GitHub-Pull-Request: golang/term#9
Reviewed-on: https://go-review.googlesource.com/c/term/+/430798
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
v0.1.0
2022-09-19 17:04:32 +00:00
Russ Cox
a9ba230a40 A+C: delete AUTHORS and CONTRIBUTORS
In 2009, Google's open-source lawyers asked us to create the AUTHORS
file to define "The Go Authors", and the CONTRIBUTORS file was in
keeping with open source best practices of the time.

Re-reviewing our repos now in 2022, the open-source lawyers are
comfortable with source control history taking the place of the
AUTHORS file, and most open source projects no longer maintain
CONTRIBUTORS files.

To ease maintenance, remove AUTHORS and CONTRIBUTORS from all repos.

For golang/go#53961.

Change-Id: I049817224d2238c682ba92fbfba1d265bea183c8
Reviewed-on: https://go-review.googlesource.com/c/term/+/419104
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-07-22 15:52:59 +00:00
ardnew
065cf7ba24 x/term: prevent invalid indexing into stRingBuffer
The exported method (*stRingBuffer).NthPreviousEntry does not correctly
handle arguments with negative values. A negative value will index
beyond slice boundaries in most cases (unless size = max = INT_MAX) and
cause an access violation at runtime.

This change adds a condition to return ok = false for all negatively
valued arguments, which is the same behavior that occurs with positively
valued arguments exceeding buffer length.

Adding the capability to index backwards (from the end of the slice)
does not seem like the intent of this method, and it would not improve
or simplify existing functionality. It would also be inconsistent with
the handling of positive values out-of-bounds.

Change-Id: Ib4113330f0044dd5b73c7d75c5cdcdd27d60ee77
GitHub-Last-Rev: fec355f536
GitHub-Pull-Request: golang/term#8
Reviewed-on: https://go-review.googlesource.com/c/term/+/408754
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-26 00:47:31 +00:00
Russ Cox
e5f449aeb1 all: gofmt
Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: Ib37025f3feda6c1ac63a48247a644dd5afac2be8
Reviewed-on: https://go-review.googlesource.com/c/term/+/399619
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-11 21:56:00 +00:00
Tobias Klauser
03fcf44c22 term: add codereview.cfg
This will let git codereview rewrite issue references to the golang/go
repo. See https://golang.org/cl/4131 for details.

Change-Id: I5d5871b8570cdd448949a5a984027f909ab521a5
Reviewed-on: https://go-review.googlesource.com/c/term/+/352590
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-09-27 22:27:41 +00:00
Tobias Klauser
f766a8b9ae term: enable TestMakeRawState on darwin/arm64
Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin).

Now that Go 1.16 is the oldest supported release, the ios tag can be
used exclusively to detect iOS and TestMakeRawState which ought to run
on darwin/arm64 can be enabled on that platform.

For golang/go#45696

Change-Id: Ic51903ea94def1f1144ca74db37533b5c4de8522
Reviewed-on: https://go-review.googlesource.com/c/term/+/352589
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-09-27 21:18:40 +00:00
Alan Donovan
140adaaadf term: add portability note re: std{in,out} fds
I recently made the mistake of assuming that stdin and stdout's
fds were 0 and 1, respectively, leading to a bug report from a
Windows user. With luck this note should prevent others from
making the same mistake.

Change-Id: I5391d91c431c3a801617f50d1b6a61121e2a939f
Reviewed-on: https://go-review.googlesource.com/c/term/+/349149
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Carlos Amedee <carlos@golang.org>
2021-09-16 21:49:54 +00:00
Bryan C. Mills
6886f2dfbf all: upgrade x/sys to latest
This fixes a build error observed in
https://build.golang.org/log/13b332a441d4d18d5358f87f945cafba3d7b9d4e.

Change-Id: I7ea6ba6e6bbeb30dabc28952306b28997410d07a
Reviewed-on: https://go-review.googlesource.com/c/term/+/328150
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-15 17:13:37 +00:00
Bryan C. Mills
a79de5458b go.mod: upgrade to go 1.17
This change was produced using 'go mod tidy -go=1.17'
with a go command built at CL 315210.

This activates lazy loading, and updates the go.mod file to maintain
the lazy-loading invariants (namely, including an explicit requirement
for every package transitively imported by the main module).

Note that this does *not* prevent users with earlier go versions from
successfully building packages from this module.

For golang/go#36460.

Change-Id: Iad25619ccbce82b91bbf51d13a79404c6e998dcc
Reviewed-on: https://go-review.googlesource.com/c/term/+/316112
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-05-03 06:03:54 +00:00
Tobias Klauser
c04ba851c2 term: unify ioctl{Read,Write}Termios definition for aix, linux, solaris & zos
These all use TCGETS/TCSETS. Rather than having a term_unix_$GOOS.go
file for each platform, unify them in a single file.

Change-Id: Iefeeadf9cf53d8fa32b1b15b8169744a819565c8
Reviewed-on: https://go-review.googlesource.com/c/term/+/314231
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-29 15:45:55 +00:00
Tobias Klauser
f5beecf764 term: skip TestMakeRawState on GOOS=ios
Change-Id: I0068c03d571672db8f809e9308e438e7b030e075
Reviewed-on: https://go-review.googlesource.com/c/term/+/312250
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-22 11:46:43 +00:00
Tobias Klauser
b80969c673 term: add aix and zos build tags
Some packages depending on golang.org/x/term still need to build with
old Go versions and adding these build tags allows them build this
package with Go 1.11 and older.

Change-Id: I82d8c71120ff82d8ace07f96636f16c86edb15e5
Reviewed-on: https://go-review.googlesource.com/c/term/+/312249
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-04-21 21:04:24 +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
makeworld
de623e64d2 term: use stdin file descriptor in comment
Using a `fd` of `0` on Windows will crash with `panic: The handle is invalid.`
By getting the file descriptor from `os.Stdin`, this can be avoided.

Change-Id: Ie7915b1e0e1018fcb92b6ba006fe85a9aee439ad
GitHub-Last-Rev: 4e56574120
GitHub-Pull-Request: golang/term#3
Reviewed-on: https://go-review.googlesource.com/c/term/+/280232
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2021-03-17 15:32:31 +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
Martin Tournoij
2321bbc49c Update doc to use "term" instead of "terminal"
Very small patch, but the example at the top still used the old
"terminal" package name, resulting in "golang.org/x/crypto/ssh/terminal"
being goimport'd instead of golang.org/x/term

Change-Id: If02a2d7ef6fe63fa86f98ca16b523d06ad897474
GitHub-Last-Rev: 594c1a04a1
GitHub-Pull-Request: golang/term#2
Reviewed-on: https://go-review.googlesource.com/c/term/+/276912
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Daniel Martí <mvdan@mvdan.cc>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Go Bot <gobot@golang.org>
2020-12-10 14:42:34 +00:00
Julie Qiu
ee85cb95a7 README.md: add badge to pkg.go.dev
Change-Id: I60b0ccc17038d457c105a0727139eb36d61b4e12
Reviewed-on: https://go-review.googlesource.com/c/term/+/275936
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-12-07 23:21:18 +00:00
Tobias Klauser
7de9c90e9d go.mod: update to latest golang.org/x/sys
This will add support for several newly added GOOS/GOARCH combinations,
e.g. netbsd/arm64.

Change-Id: I730be84e9067b3f6d0a3020d4a512975e227e718
Reviewed-on: https://go-review.googlesource.com/c/term/+/273347
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>
2020-11-26 16:20:22 +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
Mahdi Hosseini Moghaddam
c955d0b553 ssh/terminal: add support for zos
Fixes golang/go#42496

Change-Id: Iae2ddb916904d9b3947bec9638c9fbf892df7b7c
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/269177
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-11-12 15:50:50 +00:00
Hana (Hyang-Ah) Kim
07bee379ff ssh/terminal: handle ctrl+C, ctrl+F, ctrl+B
ctrl+C: terminate readline, which may result in application termination.
ctrl+F: keyRight
ctrl+B: keyLeft

Update golang/go#27147

Change-Id: If319ef79708b98c030cbce102400a785d15137f8
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/228223
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-04-14 15:58:20 +00:00
Alex Brainman
1a268e5305 ssh/terminal: adjust ReadConsole rules on windows
CL 212377 changed end of input character on windows - from \n to \r.
But CL 212377 did not adjust ReadConsole accordingly. For example,
after CL 212377 \n was still used to end of password processing,
and \r was ignored.

This CL swaps these rules - \r is now used to end password processing,
and \n are ignored. The change only affects windows, all non windows
code should work as before.

This CL also adjusts TestReadPasswordLineEnd to fit new rules.

Fixes golang/go#36609

Change-Id: I027bf80d10e7d4d4b17ff0264935d14b8bea9097
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/215417
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-02-08 06:05:01 +00:00
Yasuhiro Matsumoto
31072773c2 ssh/terminal: stop using ENABLE_LINE_INPUT
ReadConsole does not read more than 254 bytes when ENABLE_LINE_INPUT is
enabled.

Fixes golang/go#36071

Change-Id: If5c160404b855387a80f1d57638aac3f2db1a097
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/212377
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2020-01-15 08:54:10 +00:00
Tobias Klauser
ad39bd3f04 term: go mod tidy
Change-Id: If7fce055ae4d5b3aabdae161da42bd8b74de074c
Reviewed-on: https://go-review.googlesource.com/c/term/+/206159
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-11-10 17:16:34 +00:00
Dmitri Goutnik
761de043ff term: fix build on freebsd/arm64
Updates golang/go#35182

Change-Id: Ie108dbc04e97d9e120f64686fbf7fe1d51d7de5f
Reviewed-on: https://go-review.googlesource.com/c/term/+/203617
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-26 14:42:23 +00:00
Tobias Klauser
5215a04f73 term: fix build on solaris
These build tags were copied by mistake to term_solaris.go. Remove them
to fix the build on solaris.

Change-Id: I0d6c4a1bd3a9dcbb9973051cff93819ba28f1fa8
Reviewed-on: https://go-review.googlesource.com/c/term/+/201418
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-16 17:40:38 +00:00
Tobias Klauser
159e5304a9 term: use pseudo terminal in TestIsTerminalTerm on linux
Use /dev/ptmx to create a new pseudo terminal and use this in
TestIsTerminalTerm.

This should fix the test failing with ENXIO on some linux builders.

Change-Id: I39880d2cb538e3e9c8063ac79b5380ed00a476f5
Reviewed-on: https://go-review.googlesource.com/c/term/+/201417
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-16 17:06:09 +00:00
Tobias Klauser
f887077f25 term: fix build on js/wasm and nacl
Change-Id: I8ff21952a72f3f5838c9959f00d9f4c8b4b45d2d
Reviewed-on: https://go-review.googlesource.com/c/term/+/201117
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-14 20:57:23 +00: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
Brad Fitzpatrick
24acb349b8 Revert "ssh/terminal: account for win32 api changes"
This reverts commit CL 196897 (commit cf60e62b0d)

Reason for revert: we're reverting the API change instead
in https://go-review.googlesource.com/c/sys/+/197597

Change-Id: I41741c85bb7a07b9ce13264ebb26ee3f968772fa
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/197598
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
2019-09-26 18:03:35 +00:00
Jason A. Donenfeld
cf60e62b0d ssh/terminal: account for win32 api changes
The API changed for this function, since the call always succeeds.
Update this user of it accordingly.

Fixes: golang/go#34461

Change-Id: I9d19b70767fc6b1b9292ad8732dd8e54bb6a8ae0
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/196897
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-23 03:51:54 +00:00