Repository navigation
feat(interface): add ncurses terminal backend, refactor user_interface - #31
Merged
Merged
Conversation
- [x] add `TerminalBackend` class with ncurses init, dark and light themes, and render loop; - [x] handle `SIGWINCH` resize and `SIGINT` interrupts via `atomic` flags; - [x] route print, spinner, progress, input buffer, and redraw calls through the backend; - [x] move `Layout` struct and message type constants (normal, error, success) into the backend; - [x] hold a `unique_ptr` to `TerminalBackend` in `UserInterface`, remove ncurses state; - [x] replace `ui_running()` with `backend_running()` across all components; - [x] use a 100 ms `getch` timeout in `next_prompt` so it can detect backend shutdown; - [x] replace `std::exit` with `end_session` and `ExitRequest`; - [x] add `ExitRequest` with an exit code, reason, and noexcept `code()` and `what()` accessors; - [x] add `utils/exit_request.hpp` so argument handlers can throw `ExitRequest`; - [x] wrap session logic in `main` in a try block that catches `ExitRequest` and returns its code; - [x] route fatal Qdrant, Ollama, CURL, and system errors through `end_session(EXIT_FAILURE)`; - [x] remove `std::exit` from `check_ollama`, `process_response`, and `query_model_list`; - [x] keep `HttpException` for non-fatal HTTP errors when `fail_on_http_error` is false; - [x] add `#pragma once` to `http_utils` to prevent duplicate definitions; - [x] replace `EXPECT_EXIT` death tests with direct calls that check the `end_session` code; - [x] update the `UserInterface` mock to implement `backend_running()` instead of `ui_running()`;
rfprod
enabled auto-merge (squash)
November 10, 2026 19:53
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.
TerminalBackendclass with ncurses init, dark and light themes, and render loop;SIGWINCHresize andSIGINTinterrupts viaatomicflags;Layoutstruct and message type constants (normal, error, success) into the backend;unique_ptrtoTerminalBackendinUserInterface, remove ncurses state;ui_running()withbackend_running()across all components;getchtimeout innext_promptso it can detect backend shutdown;std::exitwithend_sessionandExitRequest;ExitRequestwith an exit code, reason, and noexceptcode()andwhat()accessors;utils/exit_request.hppso argument handlers can throwExitRequest;mainin a try block that catchesExitRequestand returns its code;end_session(EXIT_FAILURE);std::exitfromcheck_ollama,process_response, andquery_model_list;HttpExceptionfor non-fatal HTTP errors whenfail_on_http_erroris false;#pragma oncetohttp_utilsto prevent duplicate definitions;EXPECT_EXITdeath tests with direct calls that check theend_sessioncode;UserInterfacemock to implementbackend_running()instead ofui_running();