Skip to content

fix(schedule): use term.GetSize() instead of COLUMNS env var for timeline wrapping#222

Merged
narthur merged 3 commits intomainfrom
copilot/fix-command-timeline-output
Jan 27, 2026
Merged

fix(schedule): use term.GetSize() instead of COLUMNS env var for timeline wrapping#222
narthur merged 3 commits intomainfrom
copilot/fix-command-timeline-output

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

The buzz schedule timeline output relied on the COLUMNS environment variable for width detection. Most terminals don't set COLUMNS, causing the output to always default to 80 characters.

Changes

  • Replace os.LookupEnv("COLUMNS") with term.GetSize() syscall for actual terminal width
  • Add term.IsTerminal() check to handle piped output correctly
  • Promote github.com/charmbracelet/x/term from indirect to direct dependency

Implementation

// Before: unreliable env var lookup
width := 80
if w, ok := os.LookupEnv("COLUMNS"); ok {
    if n, err := strconv.Atoi(w); err == nil && n > 0 {
        width = n
    }
}

// After: syscall-based detection with terminal check
width := 80
fd := uintptr(os.Stdout.Fd())
if term.IsTerminal(fd) {
    if w, _, err := term.GetSize(fd); err == nil && w > 0 {
        width = w
    }
}

Timeline output now wraps correctly based on actual terminal dimensions across all environments.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt -plu�� /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper ache/go/1.24.12/x64/pkg/tool/linux_amd64/vet -plugin-opt=-pasgit -plugin-opt=-pasrev-parse -plugin-opt=-pasFETCH_HEAD ache/go/1.24.12/x64/pkg/tool/lin-v (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP tnet/tools/git test -e twork_CA_2.pem git /usr/bin/test copilot/fix-comm/usr/lib/git-core/git ux_amd64/vet e/git test -e ification_Authority_ECC.pem e/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Schedule command timeline output should wrap based on term width</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

@narthur @coderabbitai Please analyze this issue and update the description with implementation details, suggested approach, and any relevant technical considerations.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Note

Improves buzz schedule timeline wrapping by detecting actual terminal width instead of relying on the COLUMNS env var.

  • Replace os.LookupEnv("COLUMNS") with term.IsTerminal() + term.GetSize() in displayTimeline (fallback to 80 cols)
  • Add direct dependency on github.com/charmbracelet/x/term in go.mod and import in main.go

Impact: More accurate wrapping in real terminals; piped/non-TTY output remains at 80 columns.

Written by Cursor Bugbot for commit 8b789d6. This will update automatically on new commits. Configure here.

Copilot AI changed the title [WIP] Fix schedule command timeline output to wrap based on term width fix(schedule): use term.GetSize() instead of COLUMNS env var for timeline wrapping Jan 27, 2026
Copilot AI requested a review from narthur January 27, 2026 15:21
@narthur narthur marked this pull request as ready for review January 27, 2026 15:55
Copilot AI review requested due to automatic review settings January 27, 2026 15:55
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

🚀 Pre-release Build Ready

Test builds are ready! Install directly using the bin command:

# Install the pre-release
bin install https://github.com/PinePeakDigital/buzz/releases/tag/pr-222-latest buzz-pr-222
# Run the pre-release
buzz-pr-222
# Uninstall the pre-release
bin remove buzz-pr-222

Direct Download Links

Or download binaries directly from the pre-release page:

💡 No GitHub login required for downloads!

🗑️ This pre-release will be automatically deleted when the PR is closed.

Copy link
Contributor

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 updates the buzz schedule timeline so that wrapping is based on the actual terminal width instead of the COLUMNS environment variable, improving behavior across more environments and handling non-TTY output correctly.

Changes:

  • Replace COLUMNS environment-variable-based width detection in displayTimeline with term.IsTerminal + term.GetSize for syscall-based terminal width detection.
  • Ensure piped/non-interactive output falls back to a default width of 80 when stdout is not a terminal.
  • Promote github.com/charmbracelet/x/term to a direct dependency in go.mod to support the new terminal width logic.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
main.go Switches timeline width calculation from COLUMNS env lookup to term.IsTerminal + term.GetSize so wrapping reflects real terminal size, while retaining an 80‑column fallback.
go.mod Adds github.com/charmbracelet/x/term as a direct dependency, supporting the new terminal width detection logic.

Copilot AI and others added 3 commits January 27, 2026 11:54
…ping

Co-authored-by: narthur <4655422+narthur@users.noreply.github.com>
Co-authored-by: narthur <4655422+narthur@users.noreply.github.com>
@narthur narthur force-pushed the copilot/fix-command-timeline-output branch 2 times, most recently from b8163ed to 8b789d6 Compare January 27, 2026 16:56
@narthur narthur merged commit 393a426 into main Jan 27, 2026
6 checks passed
@narthur narthur deleted the copilot/fix-command-timeline-output branch January 27, 2026 17:03
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.

Schedule command timeline output should wrap based on term width

3 participants