feat: default to TUI mode, add --cat for non-interactive output#7
Merged
Conversation
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>
9f562f3 to
dac97a7
Compare
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>
dac97a7 to
1d09b94
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
termdown FILE.mdnow opens the interactive TUI instead of printing cat-style output.--tuiflag. With TUI as the default it was either a no-op or a footgun (forcing ratatui through a non-TTY stdout).--catto force non-interactive cat-style output.termdown FILE.md | lessand stdin pipelines automatically fall back to cat-style output — no flag needed.[Unreleased]section.Test plan
make check(fmt-check + clippy + test) passes — 73 unit + 9 CLI + 5 snapshot tests.cat_flag_forces_cat_output_with_file,file_arg_with_piped_stdout_falls_back_to_cat.termdown README.mdin a Kitty/Ghostty/WezTerm/iTerm2 terminal launches the TUI.termdown --cat README.mdprints cat-style output.termdown README.md | lessshows cat-style output (no TUI takeover).🤖 Generated with Claude Code