Skip to content

term: support pluggable history #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from

Conversation

ldemailly
Copy link
Contributor

@ldemailly ldemailly commented Mar 21, 2025

Expose a new History interface that allows replacement of the default
ring buffer to customize what gets added or not; as well as to allow
saving/restoring history on either the default ringbuffer or a custom
replacement.

Fixes golang/go#68780

@gopherbot
Copy link
Contributor

This PR (HEAD: b9f8be7) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 6b01958) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

This PR (HEAD: fe1e3a4) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Laurent Demailly:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: a5f4981) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

This PR (HEAD: bad1ef1) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 7: Hold+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 13c58aa) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@ldemailly ldemailly changed the title x/term: exposing history based on proposal discussion x/term: support pluggable history Apr 16, 2025
@ldemailly ldemailly force-pushed the expose_history_try_2 branch from 13c58aa to ba6dd5c Compare April 16, 2025 20:47
@gopherbot
Copy link
Contributor

This PR (HEAD: ba6dd5c) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Laurent Demailly:

Patch Set 10:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

ldemailly added a commit to fortio/terminal that referenced this pull request Apr 16, 2025
@ldemailly ldemailly changed the title x/term: support pluggable history term: support pluggable history Apr 16, 2025
@gopherbot
Copy link
Contributor

Message from Sean Liao:

Patch Set 10:

(8 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 5e07c15) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Laurent Demailly:

Patch Set 10:

(7 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 17: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 17:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 17:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 17:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Laurent Demailly:

Patch Set 17:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Laurent Demailly:

Patch Set 17:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 17:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 6212813) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/term/+/659835.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Laurent Demailly:

Patch Set 17:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 18: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2025-04-18T18:48:46Z","revision":"4a14adcb4d9366152a31670b8176408ed3c3e4bf"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 18: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18:

This CL has passed the run


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18: LUCI-TryBot-Result+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 18: Auto-Submit+1 Code-Review+2 Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2025-04-18T18:51:26Z","revision":"4a14adcb4d9366152a31670b8176408ed3c3e4bf"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 18: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jorropo:

Patch Set 18: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18:

This CL has passed the run


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Austin Clements:

Patch Set 18: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 18: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Apr 21, 2025
Expose a new History interface that allows replacement of the default
ring buffer to customize what gets added or not; as well as to allow
saving/restoring history on either the default ringbuffer or a custom
replacement.

Fixes golang/go#68780

Change-Id: I7e61dc6bb438749c8502223705518ef8ff9025b4
GitHub-Last-Rev: 6212813
GitHub-Pull-Request: #20
Reviewed-on: https://go-review.googlesource.com/c/term/+/659835
Reviewed-by: Michael Pratt <[email protected]>
Auto-Submit: Jorropo <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Jorropo <[email protected]>
Reviewed-by: Austin Clements <[email protected]>
@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2025-04-21T19:18:18Z","revision":"4a14adcb4d9366152a31670b8176408ed3c3e4bf"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Pratt:

Patch Set 18: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 18:

This CL has passed the run


Please don’t reply on this GitHub thread. Visit golang.org/cl/659835.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/659835 has been merged.

@gopherbot gopherbot closed this Apr 21, 2025
ldemailly added a commit to fortio/terminal that referenced this pull request Apr 21, 2025
…85)

* Test/new implementation for golang/term#20

* better name and expose this history impl

* Expose the AutoHistory as a field/simplify - also use the UnconditionallyAdd in AddToHistory()

* fix bug with autohistory state

* Use latest version of term PR and demo ability to output in At() as well

* Adding Len() per latest comment on proposal - even though it's a bit odd to add/expose something that isn't actually used/needed

* use the 2 calls version

* Make linters happy; return update size errors

* commented out but tested panic in History test

* No more fork - 🎉
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/term: support pluggable history
2 participants