[term] term: Allow multi-line bracketed paste to not create single line with LF entry

7 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Jul 11, 2025, 8:23:29 PMJul 11
to goph...@pubsubhelper.golang.org, Laurent Demailly, golang-co...@googlegroups.com

Gerrit Bot has uploaded the change for review

Commit message

term: Allow multi-line bracketed paste to not create single line with LF entry

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

Avoids when pasting 3 lines (with a terminal like kitty, ghostty etc.. that doesn't change the clipboard in bracketed paste mode):
```
Test> line one
line two
line three
```

Fixes golang/go#74600
Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
GitHub-Last-Rev: 76633e06ae1a2f10141abd599b856bc8e74d5380
GitHub-Pull-Request: golang/term#21

Change diff

diff --git a/terminal.go b/terminal.go
index 13e9a64..a22a7aa 100644
--- a/terminal.go
+++ b/terminal.go
@@ -146,6 +146,7 @@
keyCtrlD = 4
keyCtrlU = 21
keyEnter = '\r'
+ keyLF = '\n' // technically not a key (unless a user uses Ctrl+J), but needed for bracketed paste mode with `\n`s.
keyEscape = 27
keyBackspace = 127
keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota
@@ -567,7 +568,7 @@
t.setLine(runes, len(runes))
}
}
- case keyEnter:
+ case keyEnter, keyLF:
t.moveCursorToPos(len(t.line))
t.queue([]rune("\r\n"))
line = string(t.line)

Change information

Files:
  • M terminal.go
Change size: XS
Delta: 1 file changed, 2 insertions(+), 1 deletion(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: term
Gerrit-Branch: master
Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
Gerrit-Change-Number: 687755
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Jul 11, 2025, 8:23:32 PMJul 11
to Gerrit Bot, Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gopher Robot added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Gopher Robot . unresolved

I spotted some possible problems.

These findings are based on simple heuristics. If a finding appears wrong, briefly reply here saying so. Otherwise, please address any problems and update the GitHub PR. When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above.

Possible problems detected:
1. The first word in the commit title after the package should be a lowercase English word (usually a verb).
2. Lines in the commit message should be wrapped at ~76 characters unless needed for things like URLs or tables. You have a 130 character line.
3. Are you using markdown? Markdown should not be used to augment text in the commit message.

The commit title and commit message body come from the GitHub PR title and description, and must be edited in the GitHub web interface (not via git). For instructions, see [here](https://go.dev/wiki/GerritBot/#how-does-gerritbot-determine-the-final-commit-message). For guidelines on commit messages for the Go project, see [here](https://go.dev/doc/contribute#commit_messages).


(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: term
    Gerrit-Branch: master
    Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
    Gerrit-Change-Number: 687755
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
    Gerrit-Comment-Date: Sat, 12 Jul 2025 00:23:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Gerrit Bot (Gerrit)

    unread,
    Jul 11, 2025, 8:30:29 PMJul 11
    to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Gerrit Bot uploaded new patchset

    Gerrit Bot uploaded patch set #2 to this change.
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: term
    Gerrit-Branch: master
    Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
    Gerrit-Change-Number: 687755
    Gerrit-PatchSet: 2
    unsatisfied_requirement
    open
    diffy

    Gerrit Bot (Gerrit)

    unread,
    Jul 11, 2025, 8:57:54 PMJul 11
    to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Gerrit Bot uploaded new patchset

    Gerrit Bot uploaded patch set #5 to this change.
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: term
      Gerrit-Branch: master
      Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
      Gerrit-Change-Number: 687755
      Gerrit-PatchSet: 5
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Gerrit Bot (Gerrit)

      unread,
      Jul 13, 2025, 8:13:02 PMJul 13
      to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Gerrit Bot uploaded new patchset

      Gerrit Bot uploaded patch set #6 to this change.
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: term
      Gerrit-Branch: master
      Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
      Gerrit-Change-Number: 687755
      Gerrit-PatchSet: 6
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Gerrit Bot (Gerrit)

      unread,
      Jul 13, 2025, 8:33:05 PMJul 13
      to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Gerrit Bot uploaded new patchset

      Gerrit Bot uploaded patch set #7 to this change.
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: term
      Gerrit-Branch: master
      Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
      Gerrit-Change-Number: 687755
      Gerrit-PatchSet: 7
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Gerrit Bot (Gerrit)

      unread,
      Jul 13, 2025, 8:40:01 PMJul 13
      to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Gerrit Bot uploaded new patchset

      Gerrit Bot uploaded patch set #8 to this change.
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: term
      Gerrit-Branch: master
      Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
      Gerrit-Change-Number: 687755
      Gerrit-PatchSet: 8
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Michael Pratt (Gerrit)

      unread,
      Jul 15, 2025, 5:13:02 PMJul 15
      to Gerrit Bot, Laurent Demailly, goph...@pubsubhelper.golang.org, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Austin Clements and Jorropo

      Michael Pratt voted and added 1 comment

      Votes added by Michael Pratt

      Commit-Queue+1

      1 comment

      Commit Message
      Line 16, Patchset 8 (Latest):Test> line one
      ..............line.two
      ......................line.three
      Michael Pratt . unresolved

      This issue reminds me of all the annoyances I used to have using screen with serial connections with microcontrollers. :)

      ----

      Do we have any documentation on the specific standard (or reference implementation) is meant to match? The immediate documentation just says "VT100", which seems a bit vague to me (but maybe it's not, TBH I'm not super familiar with terminal details).

      For example, is this intended to behave like the Unix 98 psuedoterminal you get from posix_openpt (https://man7.org/linux/man-pages/man7/pty.7.html) with the default termios (https://man7.org/linux/man-pages/man3/termios.3.html)? That seems like a reasonable target to me, but I'm not sure if that is the intention.

      Strictly speaking, I believe the standard definition is that line feed moves to the next line, without changing horizontal position. And carriage return moves the cursor to the leftmost column, without changing vertical position. Hence CRLF to go to the beginning of the next line. It sounds like this is the current behavior of Terminal.

      But many terminal implementations do modify this behavior.

      On my machine, it looks like the default termios are `ioctl(0, TCGETS, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0`.

      `ICRNL` is "Translate carriage return to newline on input", which literally replaces an input `\r` with `\n` [1].

      `ONLCR` is "Map NL to CR-NL on output", which prints `\r\n` when outputting `\n`.

      Combined, I believe these options yield the same behavior as you've implemented in this CL [2].

      Still, without knowing exactly what kind of terminal Terminal is supposed to emulate [3], it's hard to say if this CL is OK, or if it would break users.

      [1] gVisor has a reasonably complete psuedoterminal implementation, which I find much more readable as a reference than Linux itself: https://github.com/google/gvisor/blob/master/pkg/sentry/fsimpl/devpts/line_discipline.go#L453-L456

      [2] I think it might be easier to see this equivalence if this CL was reframed in the same terms as replacing input `\r` with `\n`. I'm not sure how difficult that would be.

      [3] We can see that https://cs.opensource.google/go/x/term/+/master:terminal.go;l=570-572;drc=a809085bff595080269599dbe788dd7fdf616ab4 hard-codes the `ONLCR` behavior.

      (Apologies in advance, I'm sure I mixed up LF and CR somewhere above)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Austin Clements
      • Jorropo
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: term
        Gerrit-Branch: master
        Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
        Gerrit-Change-Number: 687755
        Gerrit-PatchSet: 8
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Austin Clements <aus...@google.com>
        Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
        Gerrit-Attention: Austin Clements <aus...@google.com>
        Gerrit-Attention: Jorropo <jorro...@gmail.com>
        Gerrit-Comment-Date: Tue, 15 Jul 2025 21:12:59 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        open
        diffy

        Laurent Demailly (Gerrit)

        unread,
        Jul 15, 2025, 5:28:04 PMJul 15
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Austin Clements and Jorropo

        Laurent Demailly added 2 comments

        Patchset-level comments
        File-level comment, Patchset 8 (Latest):
        Laurent Demailly . resolved

        thanks a lot for having looked, here are some notes/lmk next steps

        Commit Message
        Line 16, Patchset 8 (Latest):Test> line one
        ..............line.two
        ......................line.three
        Michael Pratt . unresolved

        This issue reminds me of all the annoyances I used to have using screen with serial connections with microcontrollers. :)

        ----

        Do we have any documentation on the specific standard (or reference implementation) is meant to match? The immediate documentation just says "VT100", which seems a bit vague to me (but maybe it's not, TBH I'm not super familiar with terminal details).

        For example, is this intended to behave like the Unix 98 psuedoterminal you get from posix_openpt (https://man7.org/linux/man-pages/man7/pty.7.html) with the default termios (https://man7.org/linux/man-pages/man3/termios.3.html)? That seems like a reasonable target to me, but I'm not sure if that is the intention.

        Strictly speaking, I believe the standard definition is that line feed moves to the next line, without changing horizontal position. And carriage return moves the cursor to the leftmost column, without changing vertical position. Hence CRLF to go to the beginning of the next line. It sounds like this is the current behavior of Terminal.

        But many terminal implementations do modify this behavior.

        On my machine, it looks like the default termios are `ioctl(0, TCGETS, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0`.

        `ICRNL` is "Translate carriage return to newline on input", which literally replaces an input `\r` with `\n` [1].

        `ONLCR` is "Map NL to CR-NL on output", which prints `\r\n` when outputting `\n`.

        Combined, I believe these options yield the same behavior as you've implemented in this CL [2].

        Still, without knowing exactly what kind of terminal Terminal is supposed to emulate [3], it's hard to say if this CL is OK, or if it would break users.

        [1] gVisor has a reasonably complete psuedoterminal implementation, which I find much more readable as a reference than Linux itself: https://github.com/google/gvisor/blob/master/pkg/sentry/fsimpl/devpts/line_discipline.go#L453-L456

        [2] I think it might be easier to see this equivalence if this CL was reframed in the same terms as replacing input `\r` with `\n`. I'm not sure how difficult that would be.

        [3] We can see that https://cs.opensource.google/go/x/term/+/master:terminal.go;l=570-572;drc=a809085bff595080269599dbe788dd7fdf616ab4 hard-codes the `ONLCR` behavior.

        (Apologies in advance, I'm sure I mixed up LF and CR somewhere above)

        Laurent Demailly

        So the issue shows up in the rather new-ish (as in VT100 didn't have "paste" capabilities that I am aware of) mode of bracketed paste - the goal of which is to preserve whatever it is being pasted, think of it for instance as
        ```
        cat > myfile
        ```
        which could have anything including in theory binary/NULs and characters shouldn't be changed. In that context a multi line paste does preserve the \n (on machines where LF is the line terminator)

        The slight change of behavior with this CL is that now if you hit "Ctrl-J" while term.ReadLine() is running it will act like if it was a CR / Enter - which I don't think should possibly break anything (but cue in the space bar workflow xkcd)

        I have a program that I wrote to debug / step on this issue (of difference of behavior between apple's terminal and newer ones like ghostty)

        https://github.com/fortio/tev

        Before this CL LF is just ignored and multi line commands are not a possibility anyway - outside of embedded CR+LF (from a paste)

        Re reframing - you want to me update the title or is
        > Treat "\n" (LF) like "Enter" (CR)
        enough in the decsription?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Austin Clements
        • Jorropo
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: term
          Gerrit-Branch: master
          Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
          Gerrit-Change-Number: 687755
          Gerrit-PatchSet: 8
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Austin Clements <aus...@google.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
          Gerrit-Attention: Austin Clements <aus...@google.com>
          Gerrit-Attention: Jorropo <jorro...@gmail.com>
          Gerrit-Comment-Date: Tue, 15 Jul 2025 21:28:00 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Laurent Demailly (Gerrit)

          unread,
          Jul 15, 2025, 5:33:26 PMJul 15
          to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Austin Clements and Jorropo

          Laurent Demailly added 1 comment

          Commit Message
          Laurent Demailly

          Also [3] is just that in raw mode you need CR+LF that's about output not input

          Gerrit-Comment-Date: Tue, 15 Jul 2025 21:33:22 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Laurent Demailly <ldem...@gmail.com>
          Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Gerrit Bot (Gerrit)

          unread,
          Jul 16, 2025, 12:09:40 PMJul 16
          to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Austin Clements, Jorropo and Michael Pratt

          Gerrit Bot uploaded new patchset

          Gerrit Bot uploaded patch set #9 to this change.
          Following approvals got outdated and were removed:
          • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Austin Clements
          • Jorropo
          • Michael Pratt
          Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: term
            Gerrit-Branch: master
            Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
            Gerrit-Change-Number: 687755
            Gerrit-PatchSet: 9
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            Gerrit-Attention: Michael Pratt <mpr...@google.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            unsatisfied_requirement
            open
            diffy

            Michael Pratt (Gerrit)

            unread,
            Jul 16, 2025, 1:09:15 PMJul 16
            to Gerrit Bot, Laurent Demailly, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Austin Clements and Jorropo

            Michael Pratt added 1 comment

            Commit Message
            Line 16, Patchset 8:Test> line one
            ..............line.two
            ......................line.three
            Michael Pratt

            I think I understand the problem you are having, and I agree that the new behavior seems nicer, but it's still not clear to me if we should change behavior unilaterally like this.

            e.g., this type has explicit support for bracketed paste (https://go.dev/cl/171330043). Should we be changing behavior only when paste is active (`t.pasteActive`)?

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Austin Clements
            • Jorropo
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: term
            Gerrit-Branch: master
            Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
            Gerrit-Change-Number: 687755
            Gerrit-PatchSet: 9
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            Gerrit-Comment-Date: Wed, 16 Jul 2025 17:09:11 +0000
            unsatisfied_requirement
            open
            diffy

            Laurent Demailly (Gerrit)

            unread,
            Jul 16, 2025, 1:36:04 PMJul 16
            to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Austin Clements and Jorropo

            Laurent Demailly added 1 comment

            Commit Message
            Laurent Demailly

            Yes, we could limit it to paste mode only with a few more ifs/checks, but what is the downside of treating LF/CR(and CR+LF) all the same when the api is about reading a single line? It seems to me it's more likely to work in all cases, with all keyboards and possible new lines in input / terminal / if caller are forgetting to set paste mode.

            Is it a positive feature that without this change, on unix for instance, if I hit ctrl-J (ie send a LF) nothing happens (it's ignored/skipped/not added to the line)

            Let me add tests that are missing.

            Gerrit-Comment-Date: Wed, 16 Jul 2025 17:35:59 +0000
            unsatisfied_requirement
            open
            diffy

            Gerrit Bot (Gerrit)

            unread,
            Jul 16, 2025, 1:43:15 PMJul 16
            to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Austin Clements, Jorropo and Michael Pratt

            Gerrit Bot uploaded new patchset

            Gerrit Bot uploaded patch set #10 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Austin Clements
            • Jorropo
            • Michael Pratt
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: term
            Gerrit-Branch: master
            Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
            Gerrit-Change-Number: 687755
            Gerrit-PatchSet: 10
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            unsatisfied_requirement
            open
            diffy

            Gerrit Bot (Gerrit)

            unread,
            Jul 16, 2025, 2:05:12 PMJul 16
            to Laurent Demailly, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Austin Clements, Jorropo and Michael Pratt

            Gerrit Bot uploaded new patchset

            Gerrit Bot uploaded patch set #11 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Austin Clements
            • Jorropo
            • Michael Pratt
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: term
            Gerrit-Branch: master
            Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
            Gerrit-Change-Number: 687755
            Gerrit-PatchSet: 11
            unsatisfied_requirement
            open
            diffy

            Laurent Demailly (Gerrit)

            unread,
            Jul 21, 2025, 12:32:43 PMJul 21
            to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Austin Clements, Jorropo and Michael Pratt
            Commit Message
            Laurent Demailly

            @mpr...@google.com did I clarify, do the tests I added help? next steps?

            Thanks

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Austin Clements
            • Jorropo
            • Michael Pratt
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: term
            Gerrit-Branch: master
            Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
            Gerrit-Change-Number: 687755
            Gerrit-PatchSet: 11
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            Gerrit-Attention: Michael Pratt <mpr...@google.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            Gerrit-Comment-Date: Mon, 21 Jul 2025 16:32:39 +0000
            unsatisfied_requirement
            open
            diffy

            Michael Pratt (Gerrit)

            unread,
            Jul 21, 2025, 12:36:28 PMJul 21
            to Gerrit Bot, Laurent Demailly, goph...@pubsubhelper.golang.org, Michael Pratt, Go LUCI, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Austin Clements, Jorropo and Laurent Demailly

            Michael Pratt voted and added 1 comment

            Votes added by Michael Pratt

            Code-Review+2
            Commit-Queue+1

            1 comment

            Commit Message
            Line 16, Patchset 8:Test> line one
            ..............line.two
            ......................line.three
            Michael Pratt . resolved
            Michael Pratt

            I am OK with the CL as-is, the behavior does seem better. However I'm still not 100% confident that we won't hear from someone broken with a case we aren't thinking of. So perhaps we'll need to change this, but we can play it by ear.

            Thanks for adding the tests.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Austin Clements
            • Jorropo
            • Laurent Demailly
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: term
            Gerrit-Branch: master
            Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
            Gerrit-Change-Number: 687755
            Gerrit-PatchSet: 11
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
            Gerrit-Attention: Laurent Demailly <ldem...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            Gerrit-Comment-Date: Mon, 21 Jul 2025 16:36:25 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Michael Knyszek (Gerrit)

            unread,
            Jul 21, 2025, 12:53:42 PMJul 21
            to Gerrit Bot, Laurent Demailly, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Austin Clements, Jorropo and Laurent Demailly

            Michael Knyszek voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Austin Clements
            • Jorropo
            • Laurent Demailly
            Submit Requirements:
              • requirement satisfiedCode-Review
              • requirement satisfiedNo-Unresolved-Comments
              • requirement satisfiedReview-Enforcement
              • requirement satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: term
              Gerrit-Branch: master
              Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
              Gerrit-Change-Number: 687755
              Gerrit-PatchSet: 11
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Austin Clements <aus...@google.com>
              Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
              Gerrit-CC: Gopher Robot <go...@golang.org>
              Gerrit-CC: Laurent Demailly <ldem...@gmail.com>
              Gerrit-Attention: Laurent Demailly <ldem...@gmail.com>
              Gerrit-Attention: Austin Clements <aus...@google.com>
              Gerrit-Attention: Jorropo <jorro...@gmail.com>
              Gerrit-Comment-Date: Mon, 21 Jul 2025 16:53:39 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              Michael Pratt (Gerrit)

              unread,
              Jul 21, 2025, 3:13:33 PMJul 21
              to Gerrit Bot, Laurent Demailly, Michael Pratt, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Knyszek, Go LUCI, Austin Clements, Jorropo, Gopher Robot, golang-co...@googlegroups.com

              Michael Pratt submitted the change

              Change information

              Commit message:
              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-by: Michael Pratt <mpr...@google.com>
              Reviewed-by: Michael Knyszek <mkny...@google.com>
              Files:
              • M terminal.go
              • M terminal_test.go
              Change size: M
              Delta: 2 files changed, 51 insertions(+), 2 deletions(-)
              Branch: refs/heads/master
              Submit Requirements:
              • requirement satisfiedCode-Review: +2 by Michael Pratt, +1 by Michael Knyszek
              • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
              Open in Gerrit
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: merged
              Gerrit-Project: term
              Gerrit-Branch: master
              Gerrit-Change-Id: I4a86044a4a175eccb3a96dbf7021fee97a5940ce
              Gerrit-Change-Number: 687755
              Gerrit-PatchSet: 12
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages