feat(tui): full keyboard support for config TUI and chat slash completion

Add Header/Footer with visible key hints, ctrl+right/ctrl+left tab navigation,
ctrl+s save bindings for General and plugin config tabs, e/d bindings for
plugin enable/disable in the Plugins tab. Extract shared _do_save() and
_toggle_plugin() helpers so button and key paths share one code path.

Add WordCompleter to the chat REPL so Tab completes slash commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-05-18 23:11:39 +02:00
parent 54241a9e4e
commit 1412ced7a8
2 changed files with 73 additions and 18 deletions
+8 -4
View File
@@ -2,6 +2,7 @@ from __future__ import annotations
import litellm
from prompt_toolkit import PromptSession
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.history import FileHistory
from pyra.chat.history import ConversationHistory
@@ -159,12 +160,15 @@ def start_chat() -> None:
))
history = ConversationHistory(cfg, registry)
session: PromptSession = PromptSession(
history=FileHistory(str(_HISTORY_FILE)),
multiline=False,
)
plugin_slash = registry.get_slash_commands()
all_commands = list(_STATIC_COMMANDS) + list(plugin_slash)
session: PromptSession = PromptSession(
history=FileHistory(str(_HISTORY_FILE)),
completer=WordCompleter(all_commands, sentence=True),
complete_while_typing=False,
multiline=False,
)
provider = get_provider(cfg.ai.provider_id)
render_system(