Skip to content

Avoid DECRQM and DECRQSS queries on Terminal.app - #417

Merged
jquast merged 6 commits into
masterfrom
jq/decrqm-terminal-app-leak
Sep 14, 2026
Merged

jquast merged 6 commits into
masterfrom
jq/decrqm-terminal-app-leak

Conversation

@jquast

@jquast jquast commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Terminal.app has "leaky output", it fails to parse some VT100 control codes and displays their contents, this can create "garbage output" to a screen and confuse a user. The API's are meant to be non-destructive and should not forward the cursor as it does.

And so, if TERM_PROGRAM environment variable matches Apple_Terminal, or, delayed XTVERSION query result is the same, then, we return False for any capability that intends to use control codes known to leak.

This has the disadvantage of "slowing down" and slightly modifying behavior of existing queries, that these queries now also contain an XTVERSION query for get_decrqss(), and get_dec_mode(), where previously they did not, and they did not previously suffer that. The results are cached, and so subsequent checks of terminal program name will not incur further queries.

Avoid DECRQM and DECRQSS queries on Apple's Terminal.app.

This requires mixing in an 'XTVERSION' query for get_decrqss(), and
get_dec_mode().
@codspeed

codspeed Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing jq/decrqm-terminal-app-leak (b05ea05) with master (6b2a7f0)

Open in CodSpeed

@codecov

codecov Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (6b2a7f0) to head (b05ea05).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
+ Coverage   97.45%   97.72%   +0.27%     
==========================================
  Files          13       13              
  Lines        4044     4052       +8     
  Branches      736      739       +3     
==========================================
+ Hits         3941     3960      +19     
+ Misses         83       71      -12     
- Partials       20       21       +1     

☔ 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.

@jquast jquast changed the title Workarounds for "leaky output" of Apple's Terminal Avoid DECRQM and DECRQSS queries on Terminal.app Sep 14, 2026
@jquast
jquast merged commit 362dbe2 into master Sep 14, 2026
12 of 13 checks passed
@jquast
jquast deleted the jq/decrqm-terminal-app-leak branch September 14, 2026 18:21
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