Skip to content

fix(terminal): use tail expression for macOS terminal detection - #1295

Closed
ianalitis wants to merge 1827 commits into
1jehuang:masterfrom
ianalitis:jcode/fix-macos-terminal-tail-match
Closed

ianalitis wants to merge 1827 commits into
1jehuang:masterfrom
ianalitis:jcode/fix-macos-terminal-tail-match

Conversation

@ianalitis

@ianalitis ianalitis commented Sep 18, 2026

Copy link
Copy Markdown

Closes #1294

Summary

  • Make the macOS terminal-detection match a tail expression by removing only return and its trailing semicolon.
  • Preserve all terminal aliases, precedence, platform cfgs, and existing tests. No runtime behavior change is intended.
  • Keep the source file at 1,692 lines. No lint suppression, budget adjustment, or unrelated formatting.

Validation

On macOS / Apple Silicon, Rust 1.94.1:

scripts/dev_cargo.sh clippy --offline --locked -p jcode-terminal-launch --lib -- -D warnings

Pristine upstream 5cb7b3dad6029a6f868e36fd4c13cbd07d1fca50 fails with clippy::needless_return at lines 269–273. Candidate 5d501a7cbfeff68224e89bc138973a36721b302d passes the same command. Both implementation validation and an independent acceptance run passed.

All three existing focused tests passed independently, each 1 passed / 0 failed / 0 ignored, using test --offline --locked -p jcode-terminal-launch --lib <selector> -- --exact --test-threads=1:

  • tests::term_program_detects_supported_emulators_cross_platform
  • tests::tmux_client_context_is_preferred_over_terminal_emulator
  • tests::explicit_terminal_override_stays_ahead_of_tmux

No new tests are added for this behavior-preserving lint correction. These existing tests cover adjacent detection/precedence, not exhaustive macOS alias cases. No terminal-launch, Linux, or Windows runtime validation is claimed.

Review readiness and CI limits

This is intentionally separate from #1293 and does not claim full workspace CI is green. Existing upstream workspace compilation, Clippy, formatting, and budget failures were documented in #1293. This PR addresses only the package-level macOS needless_return diagnostic. Official code-size and test-size gates still fail, with output byte-for-byte identical to the pristine upstream baseline. Neither failure is waived or increased. The patch passes whitespace checks and preserves the exact same delta after formatting both file versions in scratch. Whole-file/workspace formatting was not swept into this patch, and full workspace CI was not rerun for this narrow correction.

Ready for maintainer review: the scoped change is complete. On September 18, package Clippy and the three exact existing tests passed again on the exact submitted commit. This is not a merge-ready or full-workspace-CI claim.

Workflow assessment: .github/workflows/ci.yml currently has duplicate top-level env keys, already addressed by the open #1193. The issue-link workflow includes ready_for_review; the main CI workflow does not explicitly include that activity type. Existing issue-link runs report action_required with zero jobs. Maintainer workflow approval and repair of the existing CI definition are still needed for usable remote validation. No repository settings or workflow code were changed by this PR.

1jehuang and others added 30 commits August 25, 2026 22:44
@ianalitis
ianalitis marked this pull request as ready for review September 18, 2026 04:11
@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

Safe to merge: no actionable issues were found in the changed terminal-detection code.

What we checked:

  • Created and ran a terminal-detection behavior comparison to validate the change; the environment was Linux-only, so macOS execution was not performed. T-Rex
  • Verified that the relevant terminal-detection unit test passed on both revisions. T-Rex
  • Verified that strict linting passed on the updated jcode-terminal-launch package. T-Rex
  • Authored an executable validation script and used it to compare baseline and post-change outputs for terminal-launch tail expressions. T-Rex
  • Compared baseline and changed-revision outputs; baseline exit code 0 with test passing, changed-revision exit 0 with the test and clippy passing, and Linux-only target confirmed. T-Rex

Summary

  • Simplifies the macOS terminal-detection branch by using its match expression as the function’s tail value.
  • The relevant terminal-detection behavior is unchanged, and the package passes strict linting.

Reviews (1) · Last reviewed commit: "fix(terminal): use tail expression for m..."

@ianalitis

Copy link
Copy Markdown
Author

Closing as superseded by the focused PR #1354, which includes this macOS terminal needless_return fix without this old branch's unrelated integration ancestry. Issue #1294 remains open until the replacement lands.

@ianalitis ianalitis closed this Sep 21, 2026
@ianalitis
ianalitis deleted the jcode/fix-macos-terminal-tail-match branch September 22, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Restructures code without intended behavior changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: terminal-launch Clippy fails on unnecessary tail return

3 participants