Skip to content

fix(cli): clean up link and cursor escapes in non-terminal output - #1261

Merged
trunk-io[bot] merged 2 commits into
mainfrom
max/plain-links-when-not-tty
Oct 27, 2026
Merged

trunk-io[bot] merged 2 commits into
mainfrom
max/plain-links-when-not-tty

Conversation

@max-trunk

@max-trunk max-trunk commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

#1230 changed two things that show up badly in log viewers that aren't a terminal, such as GitHub Actions:

  • Links disappear. Test and upload links are wrapped in OSC 8 hyperlink escapes unconditionally. The log viewer drops the link text along with the escape, so the ⤷ test links and the 🏷️ Upload: link are empty.
  • 25l/25h at the start of lines. The superconsole upgrade wraps every frame in cursor hide/show escapes (ESC[?25l / ESC[?25h). The log viewer doesn't recognise them and prints the tail of each one.

This PR:

  • Only attaches the hyperlink when SuperConsole::compatible() is true, i.e. stderr is an interactive, non-dumb terminal. Otherwise the URL is printed as plain styled text, as before Make the URLs clickable #1230.
  • When superconsole falls back to its forced (non-TTY) console, writes stderr through a filter that drops only the cursor hide/show escapes. Interactive terminals are unchanged.

Testing

  • Unit tests for both: the link span with and without the hyperlink, and the escape filter keeping every other escape.
  • Ran trunk-analytics-cli validate with stderr redirected to a file: no cursor visibility or OSC 8 escapes in the output.
  • cargo test -p trunk-analytics-cli --test upload: all pass except the three Swift xunit tests, which fail the same way on main locally.

🤖 Generated with Claude Code

OSC 8 hyperlink escapes are only emitted when superconsole is drawing to
a compatible TTY. Log viewers such as GitHub Actions drop the link text
along with the escape, so test and upload links disappeared from CI logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

…minal

The superconsole upgrade wraps every frame in cursor hide/show escapes,
which GitHub Actions prints as 25l/25h at the start of each line. Filter
them from stderr when superconsole falls back to its non-TTY console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@max-trunk max-trunk changed the title fix(cli): print plain URLs when not writing to an interactive terminal fix(cli): clean up link and cursor escapes in non-terminal output Oct 27, 2026
@trunk-staging-io

trunk-staging-io Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

Failed Test Failure Summary Logs
pending_quarantine_test should be quarantined when run with variant A test marked as pending was expected to fail but unexpectedly passed. Logs ↗︎
variant_quarantine_test should be quarantined when run with variant The test failed because it expected 2 + 2 to equal 5, but the result was 4. Logs ↗︎

View Full Report ↗︎ ⋅ Docs

@codecov-commenter

codecov-commenter commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.20%. Comparing base (6c4025c) to head (b8c55e7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
display/src/render.rs 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1261      +/-   ##
==========================================
+ Coverage   83.94%   84.20%   +0.25%     
==========================================
  Files          74       74              
  Lines       17958    18003      +45     
==========================================
+ Hits        15075    15159      +84     
+ Misses       2883     2844      -39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trunk-io
trunk-io Bot merged commit bf8b419 into main Oct 27, 2026
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants