12 Commits
Author SHA1 Message Date
gitea-adminandClaude Fable 5.1 ac6bb30f47 Unify terminal display-width helpers
key_help, selector and control each carried their own East Asian width
and truncation logic with slightly different rules, and cli clipped tmux
labels by code point, so a CJK display name ran twice as wide as an
ASCII one before its ellipsis appeared.

Move the cell-width helpers into herdr_hub.text, make truncate_label
cell-aware, and sanitise control characters before curses draws a row
so an escape sequence in a remote error cannot be rendered as ^[ and
misalign the list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 03:09:28 +00:00
gitea-adminandClaude Fable 5.1 435ba91d1e Load local sessions in the background for the Sessions popup
command_choose ran `herdr session list --json` (up to its 5 s timeout)
before the popup drew anything, contradicting the documented immediate
display. Run the listing on a worker thread and hand the selector a
Future: the popup appears at once with a "… 本机 正在查询" placeholder,
then fills in the local rows and any discovery warning when the result
arrives, mirroring how remote hosts already load.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 03:03:09 +00:00
gitea-adminandClaude Fable 5.1 907813867a Batch tmux configuration into single client invocations
configure() ran one tmux client per option and per key binding, and
refresh_labels() one or two per window, on every start/refresh/open: a
no-op refresh with three windows spawned 45 tmux processes. On a phone
each spawn is noticeable.

Add run_batch(), which joins commands with ';' separators (escaping
arguments that end in ';', which tmux would otherwise split) and replays
them one by one if the batch fails so errors stay attributable. Use it
for configure(), window creation, endpoint replacement and label
refreshes. list-windows now also reports the stored short label so
unchanged labels are skipped, and managed_windows() no longer probes
has-session first. The same no-op refresh now spawns 9 processes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 03:02:31 +00:00
gitea-adminandClaude Fable 5.1 ebbd5821fd Harden Hub startup and display-name handling
- Display names starting with '-' were parsed by tmux rename-window as
  flags. The alias was persisted before tmux rejected it, so every later
  start/refresh/open failed in refresh_labels until aliases.json was
  edited by hand. Guard rename-window with '--', apply the name before
  persisting it, and roll back the in-memory table on failure.
- Start the Hub tmux server with -f /dev/null by default. Reading the
  user's ~/.tmux.conf let theme status-formats replace the Sessions bar
  and root-table bindings leak into Herdr; HERDR_HUB_TMUX_CONFIG still
  opts into a custom file.
- An unreadable aliases.json blocked start/refresh/open/choose. Degrade
  to default names with a warning (stderr, or the popup message) and
  leave the file untouched for `doctor` to report.
- `doctor` crashed with a traceback when a *_BIN override pointed at a
  missing executable; report it as a failure instead.
- Refuse to run inside another tmux server before discovery and server
  creation, so no unattached Hub is left behind.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 02:58:45 +00:00
gitea-admin 6f933e1c80 Add Herdr update and live handoff menu actions
The Ctrl+A h command menu gains two host-scoped actions: a plain
`herdr update` that streams updater output into the popup, and an
experimental update-and-hot-restart flow that verifies a live server
handoff and reconnects the originating Hub tab once the popup closes.

Remote updates use the remote host's own proxy settings. A standalone
helper reads literal proxy assignments from shell profiles and running
Clash/Mihomo listeners without executing startup files; Windows reads
process, user and machine proxy variables through PowerShell.
2026-10-03 02:51:44 +00:00
gitea-admin a5e8e32f1e Add shortcut help popup 2026-09-18 14:32:58 +00:00
gitea-admin 6e420b2db5 Add Herdr agent fork command menu 2026-09-18 09:07:04 +00:00
gitea-admin d6697d46f8 Keep session manager open on launch failure 2026-09-12 18:25:39 +00:00
gitea-admin 36bee161cb Simplify session manager interaction model 2026-09-03 14:42:25 +00:00
gitea-admin b12f2c4986 Allow deleting stopped sessions with stale tabs 2026-09-03 14:05:24 +00:00
gitea-admin 02d83a04bd Improve remote session management and Windows support 2026-09-03 12:58:24 +00:00
gitea-admin 6c2c9672e1 Initial release of herdr session switcher 2026-09-02 01:33:38 +00:00