Skip to content

feat: default to TUI mode, add --cat for non-interactive output#7

Merged
rrbe merged 4 commits into
masterfrom
feat/default-tui-mode
May 20, 2026
Merged

feat: default to TUI mode, add --cat for non-interactive output#7
rrbe merged 4 commits into
masterfrom
feat/default-tui-mode

Conversation

@rrbe
Copy link
Copy Markdown
Owner

@rrbe rrbe commented May 20, 2026

Summary

  • BREAKING: Reverse the CLI default — termdown FILE.md now opens the interactive TUI instead of printing cat-style output.
  • BREAKING: Remove the --tui flag. With TUI as the default it was either a no-op or a footgun (forcing ratatui through a non-TTY stdout).
  • Add --cat to force non-interactive cat-style output.
  • Stdout TTY-ness is checked, so termdown FILE.md | less and stdin pipelines automatically fall back to cat-style output — no flag needed.
  • Bump version to 0.5.0 and lock the CHANGELOG [Unreleased] section.
  • README / README_CN updated to describe the new defaults.

Test plan

  • make check (fmt-check + clippy + test) passes — 73 unit + 9 CLI + 5 snapshot tests.
  • New CLI tests: cat_flag_forces_cat_output_with_file, file_arg_with_piped_stdout_falls_back_to_cat.
  • Manual: termdown README.md in a Kitty/Ghostty/WezTerm/iTerm2 terminal launches the TUI.
  • Manual: termdown --cat README.md prints cat-style output.
  • Manual: termdown README.md | less shows cat-style output (no TUI takeover).

🤖 Generated with Claude Code

rrbe and others added 3 commits May 20, 2026 11:43
Reverse the previous default: passing a file now opens the interactive
TUI, and the cat-style renderer is reached via the new `--cat` flag. The
old `--tui` flag still works as an explicit opt-in. Stdout is checked
for TTY-ness so `termdown FILE | less` and stdin pipelines keep
producing plain output without needing `--cat`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Remove the unreachable `"TUI mode"` arm in the missing-file error;
  the implicit-TUI path already requires a real file, so only `--tui`
  can land in that match arm.
- Add an Unreleased section to CHANGELOG.md flagging the default-mode
  reversal as a BREAKING change and documenting the new `--cat` flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
With TUI as the default, `--tui` was either a no-op (when stdout is a
terminal) or a footgun (forcing ratatui through a non-TTY stdout, where
it can't render). Drop it. `--cat` remains the only mode switch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rrbe rrbe force-pushed the feat/default-tui-mode branch from 9f562f3 to dac97a7 Compare May 20, 2026 05:18
Document the bump exception to the no-direct-commits rule: version
bumps are the only commits that go straight to master, kept as
standalone commits (not bundled into feature PRs). Pushing the
vX.Y.Z tag both stamps the version and triggers release.yml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rrbe rrbe force-pushed the feat/default-tui-mode branch from dac97a7 to 1d09b94 Compare May 20, 2026 06:31
@rrbe rrbe merged commit d50be4b into master May 20, 2026
5 checks passed
@rrbe rrbe deleted the feat/default-tui-mode branch May 20, 2026 06:45
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