Release v0.1.0#12
Conversation
- HelpCommand.RunAsync launches a TUI Markdown viewer (Runnable + Markdown + StatusBar) matching clet's pattern, instead of returning raw text in CommandResult - MetadataHelpProvider.GetRootHelp emits markdown (tables, headers) instead of plain text - CliHost.WriteRootFlag passes --help output through MarkdownRenderer.RenderToAnsi for ANSI-styled stdout - Rename examples/Terminal.Gui.Cli.ExampleApp to examples/greet with AssemblyName=greet - Add README.md for the greet example app - Add visual UI tests (CommandUiHarness + golden-file assertions) ported from clet's CletUiHarness pattern - Add MetadataHelpProviderTests and CliHost help rendering tests Closes #5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Port clet's MarkdownHelpRenderer approach: set Console.OutputEncoding to UTF-8 before rendering, use a full TG ANSI driver with proper layout/draw cycle, and restore encoding afterward. Fixes garbled box-drawing chars. - Add FarewellCommand with --until option for navigation testing - Add embedded markdown help files (help.md, greet.md, farewell.md, info.md) - Configure EmbeddedMarkdownHelpProvider in greet example - Fix InfoCommand to properly launch TUI viewer (was returning text without calling app.RunAsync, causing terminal to hang until Enter pressed) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… args - Add DefaultCommand option to CliHostOptions so bare args/options are retried as the default command (e.g. 'greet World' == 'greet greet World') - Refactor CliHost.RunAsync into DispatchCommandAsync/ExecuteCommandAsync - Add help:topic link navigation in HelpCommand via Markdown.LinkClicked - Add 'Back to main help' links in all sub-topic help files - Add help:command anchors in root help.md for topic navigation - Make GreetCommand and FarewellCommand accept positional args for name - Set greet example DefaultCommand = 'greet' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add BrowseBar (ported from clet) with back/forward history stacks, Ctrl+Left/Right shortcuts, and proper statusbar styling - Rewrite HelpCommand.RunAsync to match clet's HelpClet pattern: BrowseBar, LinkClicked handler, NavigateTo, viewport reset - Add TextMateSyntaxHighlighter for code block coloring - Add horizontal scrollbar to markdown view - Update golden file for new status bar layout Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- HelpBrowserUiTests: proves BrowseBar back/forward arrows render, embedded help content displays, subcommand view shows options, and golden file assertion for the browser layout - GreetExampleTests: proves every documented example in the help files actually works (greet World, --formal Alice, farewell Bob, farewell --until tomorrow Bob, default command dispatch, etc.) - Add embedded help.md resource to integration test assembly - Total: 24 integration tests, 17 unit tests (41 total, all passing) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pipe characters and newlines in command/option descriptions would break the generated markdown table structure. Add EscapeCell helper that replaces | with \| and collapses newlines to spaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ReSharper cannot infer target type for 'new' inside collection expressions, so use explicit 'new CommandOptionDescriptor(...)' instead of 'new (...)'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ple-app feat: help TUI viewer, markdown rendering, rename ExampleApp to greet
Expand README and add hero GIF
Enable source debugging and .snupkg generation for NuGet consumers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbec53dff5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| height = 24; | ||
| } | ||
|
|
||
| Environment.SetEnvironmentVariable ("DisableRealDriverIO", "1"); |
There was a problem hiding this comment.
Restore DisableRealDriverIO after ANSI render
RenderToAnsi sets DisableRealDriverIO and never restores the previous value, which mutates process-global state. Since this helper is called by --help/--cat, any later CliHost.RunAsync invocation in the same process inherits that flag and may run interactive Terminal.Gui sessions with real driver I/O disabled. Capture the prior value and restore it in finally.
Useful? React with 👍 / 👎.
|
|
||
| Environment.SetEnvironmentVariable ("DisableRealDriverIO", "1"); | ||
| IApplication app = Application.Create (); | ||
| app.Init (DriverRegistry.Names.ANSI); |
There was a problem hiding this comment.
Ensure encoding/app cleanup when Init throws
Console.OutputEncoding is changed before app.Init, but the try/finally that restores encoding and disposes the app starts only after Init. If initialization throws (for example when terminal setup fails), the method exits with UTF-8 forced and an undisposed app instance, leaking process state for subsequent commands. Move app.Init inside the protected try/finally so cleanup always runs.
Useful? React with 👍 / 👎.
Release v0.1.0
Version:
0.1.0NuGet Package:
Terminal.Gui.Cli 0.1.0What happens when this PR is merged
v0.1.0Terminal.Gui.Cli 0.1.0to NuGet.orgmain->developis openedChecklist
0.1.0