Rework TUI: single-threaded curses, scrollback buffer, server menu

- All curses drawing on the main thread; stdin polled together with the
  ZMQ sockets, Ctrl-C only sets a flag
- Output kept in a 2000-line buffer and redrawn from it, so resizes keep
  the history; PgUp/PgDn and mouse wheel scroll it
- Messages without trailing newline continue the current line (status
  table columns arrive as separate messages)
- Too-small terminal shows a warning instead of exiting
- Start without arguments shows a server selection menu
- Colors on the terminal default background; version 0.9.0
This commit is contained in:
pfl
2026-09-16 17:01:51 +02:00
parent 0613d380a4
commit db123993c0
7 changed files with 658 additions and 621 deletions
+12
View File
@@ -34,11 +34,22 @@ duel = 10.13.12.93:28961
## Usage
```bash
qlpycon # pick a server from a menu
qlpycon ffa # connect by name
qlpycon --host tcp://10.13.12.93:28960 --password secret # connect directly
qlpycon --list # list configured servers
```
Without arguments, qlpycon shows the servers from `[servers]` and connects to the one you select (Up/Down or j/k, Enter or the number key; q quits). If no servers are configured it connects to `[connection] host`.
**Keys in the console:**
- `Enter`: send the command
- `Tab`: cycle autocomplete suggestions
- `Up`/`Down`: command history
- `PgUp`/`PgDn` or mouse wheel: scroll the output back and forth (the last 2000 lines are kept)
- Hold `Shift` while selecting text with the mouse (the wheel is reported to qlpycon)
- `Ctrl-C` twice: quit
**Options:**
- `--host URI` — ZMQ RCON endpoint
- `--password PASS` — RCON password (or set `QLPYCON_PASSWORD` env var)
@@ -56,6 +67,7 @@ qlpycon --list # list configured servers
- Tab autocomplete for cvars and commands with fuzzy matching
- Argument suggestions for 25+ commands (bot names, maps, gametypes)
- Command history (↑/↓)
- Output scrollback (PgUp/PgDn) that survives terminal resizes
## Architecture