term: allow multi-line bracketed paste to not create single line with verbatim LFs

Treat "\n" (LF) like "Enter" (CR)

Avoids that when pasting 3 lines
(with a terminal like kitty, ghostty, alacritty that do not change the clipboard
in bracketed paste mode)
it turns into 1 prompt looking like:

Test> line one
..............line.two
......................line.three

Fixes golang/go#74600

Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
GitHub-Last-Rev: 0cf26df9aec994dfc61392e98b9034fe7133fb7f
GitHub-Pull-Request: golang/term#21
Reviewed-on: https://go-review.googlesource.com/c/term/+/687755
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2 files changed
tree: c128ddf93817d5cbae0a3647e02864650b589fdd
  1. codereview.cfg
  2. CONTRIBUTING.md
  3. go.mod
  4. go.sum
  5. LICENSE
  6. PATENTS
  7. README.md
  8. term.go
  9. term_plan9.go
  10. term_test.go
  11. term_unix.go
  12. term_unix_bsd.go
  13. term_unix_other.go
  14. term_unsupported.go
  15. term_windows.go
  16. terminal.go
  17. terminal_test.go
README.md

Go terminal/console support

Go Reference

This repository provides Go terminal and console support packages.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/term.

The main issue tracker for the term repository is located at https://go.dev/issues. Prefix your issue with “x/term:” in the subject line, so it is easy to find.