aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/consoletui.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix forward declaration order for s_GotSigWinch and SigWinchHandlersb/zen-helpStefan Boberg27 hours1-9/+9
| | | | | Move the SIGWINCH signal handler and its flag variable before RawModeGuard, which references them in its constructor.
* Add Markdown reference generation and interactive browser with word wrappingStefan Boberg40 hours1-57/+242
| | | | | | | | | | | | | | - Add --md flag for interactive filtered document browser: displays all command/subcommand help as a scrollable document, typing filters to show only sections whose content matches - Add --md-file <path> to write a Markdown reference file with definition lists and option category headings - Add TuiWrapLines() for ANSI-aware word wrapping with indent-preserving continuation lines; used by TuiPager and the markdown browser - TuiPager now word-wraps instead of truncating, re-wraps on resize - Extend TuiPickOne with optional SearchTexts span for filtering against auxiliary content instead of display labels - Replace std::fstream/sstream with fmt string building and IoBuffer/WriteFile
* Highlight command and subcommand names in help TUIStefan Boberg42 hours1-7/+73
| | | | | | | | | - Render command names in bright white in the picker list - Render subcommand names in bright white in the pager help text - Add ANSI-aware VisibleWidth() and TruncateAnsi() helpers so line truncation in TuiPickOne and TuiPager correctly handles escape codes - Only emit ANSI codes in interactive mode; non-interactive output remains plain text
* Simplify pager search to inline incremental modeStefan Boberg43 hours1-67/+49
| | | | | | | | - Remove separate '/' search mode — typing anywhere starts searching - Search highlights and scrolls to matches live as you type - Enter jumps to next match, Backspace edits query, Escape clears - Remove 'q' quit shortcut since all keys are now search input - Escape quits the pager when no search query is active
* Add interactive help command to zen CLIStefan Boberg43 hours1-143/+724
| | | | | | | | | | | | | | | | | - Add `zen help` command with three modes: - Interactive picker (TuiPickOne) to browse all commands by category - `zen help <command>` to view a specific command's help in a pager - `zen help --list` for non-interactive plain text listing - Extend consoletui with new TUI primitives: - Public ConsoleKey enum with PageUp/Down, Home/End, Backspace, Char, Resize - TuiReadKey()/TuiReadKeyChar() for cross-platform key input - TuiPager() for fullscreen scrollable text viewing with `/` search - Enhance TuiPickOne with incremental type-to-filter, viewport scrolling, line truncation, initial selection and filter persistence - Switch TuiPickOne to alternate screen buffer for clean resize handling - Handle console resize events (WINDOW_BUFFER_SIZE_EVENT on Windows, SIGWINCH on POSIX) - Move CommandInfo struct to zen.h for reuse by help command
* Compute batching (#849)Stefan Boberg2026-03-181-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Compute Batch Submission - Consolidate duplicated action submission logic in `httpcomputeservice` into a single `HandleSubmitAction` supporting both single-action and batch (actions array) payloads - Group actions by queue in `RemoteHttpRunner` and submit as batches with configurable chunk size, falling back to individual submission on failure - Extract shared helpers: `MakeErrorResult`, `ValidateQueueForEnqueue`, `ActivateActionInQueue`, `RemoveActionFromActiveMaps` ### Retracted Action State - Add `Retracted` state to `RunnerAction` for retry-free rescheduling — an explicit request to pull an action back and reschedule it on a different runner without incrementing `RetryCount` - Implement idempotent `RetractAction()` on `RunnerAction` and `ComputeServiceSession` - Add `POST jobs/{lsn}/retract` and `queues/{queueref}/jobs/{lsn}/retract` HTTP endpoints - Add state machine documentation and per-state comments to `RunnerAction` ### Compute Race Fixes - Fix race in `HandleActionUpdates` where actions enqueued between session abandon and scheduler tick were never abandoned, causing `GetActionResult` to return 202 indefinitely - Fix queue `ActiveCount` race where `NotifyQueueActionComplete` was called after releasing `m_ResultsLock`, allowing callers to observe stale counters immediately after `GetActionResult` returned OK ### Logging Optimization and ANSI improvements - Improve `AnsiColorStdoutSink` write efficiency — single write call, dirty-flag flush, `RwLock` instead of `std::mutex` - Move ANSI color emission from sink into formatters via `Formatter::SetColorEnabled()`; remove `ColorRangeStart`/`End` from `LogMessage` - Extract color helpers (`AnsiColorForLevel`, `StripAnsiSgrSequences`) into `helpers.h` - Strip upstream ANSI SGR escapes in non-color output mode. This enables colour in log messages without polluting log files with ANSI control sequences - Move `RotatingFileSink`, `JsonFormatter`, and `FullFormatter` from header-only to pimpl with `.cpp` files ### CLI / Exec Refactoring - Extract `ExecSessionRunner` class from ~920-line `ExecUsingSession` into focused methods and a `ExecSessionConfig` struct - Replace monolithic `ExecCommand` with subcommand-based architecture (`http`, `inproc`, `beacon`, `dump`, `buildlog`) - Allow parent options to appear after subcommand name by parsing subcommand args permissively and forwarding unmatched tokens to the parent parser ### Testing Improvements - Fix `--test-suite` filter being ignored due to accumulation with default wildcard filter - Add test suite banners to test listener output - Made `function.session.abandon_pending` test more robust ### Startup / Reliability Fixes - Fix silent exit when a second zenserver instance detects a port conflict — use `ZEN_CONSOLE_*` for log calls that precede `InitializeLogging()` - Fix two potential SIGSEGV paths during early startup: guard `sentry_options_new()` returning nullptr, and throw on `ZenServerState::Register()` returning nullptr instead of dereferencing - Fail on unrecognized zenserver `--mode` instead of silently defaulting to store ### Other - Show host details (hostname, platform, CPU count, memory) when discovering new compute workers - Move frontend `html.zip` from source tree into build directory - Add format specifications for Compact Binary and Compressed Buffer wire formats - Add `WriteCompactBinaryObject` to zencore - Extended `ConsoleTui` with additional functionality - Add `--vscode` option to `xmake sln` for clangd / `compile_commands.json` support - Disable compute/horde/nomad in release builds (not yet production-ready) - Disable unintended `ASIO_HAS_IO_URING` enablement - Fix crashpad patch missing leading whitespace - Clean up code triggering gcc false positives
* Add `zen ui` command (#779)Stefan Boberg2026-02-241-0/+483
Allows user to automate launching of zenserver dashboard, including when multiple instances are running. If multiple instances are running you can open all dashboards with `--all`, and also using the in-terminal chooser which also allows you to open a specific instance. Also includes a fix to `zen exec` when using offset/stride/limit