feat: COMMAND-mode Tab completion + newcomer onboarding + tntctl shell completion#62
Merged
Conversation
Add command_catalog_complete(): a tested, case-insensitive prefix completer over canonical command names that reports matches and their longest common prefix. Wire Tab in COMMAND mode (mirroring the existing INSERT @mention Tab): - ':the'+Tab -> ':theme '; unique prefixes complete fully. - Ambiguous prefixes fill the longest common prefix and show candidates inline on the status line (e.g. ':m' -> 'msg mute-joins'); ':'+Tab lists all. - First-argument completion for closed sets: ':theme '/':lang ' values and online usernames for ':msg '/':w ' (reusing room data like @mention). New tui_render_command_hint() renders the dim, width-truncated candidate list. Covered by command_catalog unit tests and an interactive expect regression.
Add a dim, centered 'getting started' line under the welcome banner (shown to every connecting user before the name prompt) and expand the always-visible wide INSERT-mode hint to surface ':' commands and ':help'. The empty-room placeholder is intentionally not used for onboarding since joining always writes a system message, so it is never shown to a logged-in user. Both new strings are localized (en/zh).
Add packaging/completions/ with bash, zsh, and fish completion for tntctl: option flags, the stable subcommands (health/stats/users/tail/dump/post/ help/exit), --json after users/stats, and --host-key-checking modes. The remote host is free-form and intentionally not completed. Includes install instructions in packaging/completions/README.md.
Add the Tab completion keybinding to README, QUICKREF, and the tnt.1 man page in the same change set as the feature.
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.
Makes TNT's commands discoverable for both the developer/Vim majority and first-time/non-technical users. All changes are core UX or packaging — no gating, equal for every user.
1. COMMAND-mode Tab completion (for the dev/Vim majority)
Mirrors the existing INSERT
@mentionTab completion.:the+Tab →:theme; unique prefixes complete fully.:m→msg mute-joins);:+Tab lists all commands.:theme/:langvalues, and online usernames for:msg/:w(reuses room data like @mention).command_catalog_complete()+tui_render_command_hint().2. Newcomer onboarding (for non-technical users)
i type · Enter send · : commands · :help guide.:commands and:help.3. tntctl shell completion (for the CLI side)
packaging/completions/with bash, zsh, and fish completion: flags, subcommands,--jsonafterusers/stats,--host-key-checkingmodes. Install notes included.Tests & verification
command_catalog_completeunit tests (6) + interactiveexpectregression for name/ambiguous/argument completion. Full unit + interactive + docs-surface suites pass on macOS and the Linux deploy host.All i18n strings localized (en/zh).