Skip to content

Switching to new implementation / non fork version of https://github.com/golang/term/pull/20 #85

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

Merged
merged 10 commits into from
Apr 21, 2025

Conversation

ldemailly
Copy link
Member

@ldemailly ldemailly commented Mar 21, 2025

For golang/term#20 / updated golang/go#68780

Note the Add/UnconditionallyAdd is a bit awkward

@ldemailly ldemailly force-pushed the testing_expose_history_try_2 branch from 7c04ad4 to 736980f Compare April 16, 2025 21:30
@ldemailly ldemailly changed the title Test/new implementation for https://github.com/golang/term/pull/20 Switching to new implementation / non fork version of https://github.com/golang/term/pull/20 Apr 21, 2025
@ldemailly ldemailly requested a review from Copilot April 21, 2025 19:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR switches from the forked term package to the official golang.org/x/term implementation while introducing a new history management approach using TermHistory.

  • Replaces old history functions with a new TermHistory struct and corresponding methods.
  • Updates the Open function and history API calls in terminal.go.
  • Introduces a new panic command in the demo and modifies benchmark loops in tests.

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
terminal.go Migrates to golang.org/x/term and refactors history management.
example/main.go Adds a panic command and updates terminal closure logging.
ansipixels/ansipixels.go Updates term import to golang.org/x/term.
ansipixels/ansiclean_test.go Changes benchmark loop iteration method.
README.md Updates documentation to reflect switching to golang.org/x/term.
Files not reviewed (2)
  • Makefile: Language not supported
  • go.mod: Language not supported

@@ -135,7 +135,7 @@ func TestAnsiCleanHR(t *testing.T) {
func BenchmarkAnsiCleanRE(b *testing.B) {
for _, tc := range testCases {
b.Run(tc.name, func(b *testing.B) {
for i := 0; i < b.N; i++ {
for range b.N {
Copy link
Preview

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'for range b.N' is invalid because b.N is an integer. Use a standard for loop such as 'for i := 0; i < b.N; i++ {' instead.

Suggested change
for range b.N {
for i := 0; i < b.N; i++ {

Copilot uses AI. Check for mistakes.

@ldemailly ldemailly merged commit 9d54e20 into main Apr 21, 2025
9 checks passed
@ldemailly ldemailly deleted the testing_expose_history_try_2 branch April 26, 2025 05:09
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.

1 participant