feat(tui): add option to remember view state between sessions (#17)

This commit is contained in:
Karol Broda
2025-12-25 18:22:54 +01:00
committed by GitHub
parent 5414e39e61
commit 1cff272fff
7 changed files with 483 additions and 22 deletions

View File

@@ -238,8 +238,23 @@ optional config file at `~/.config/snitch/snitch.toml`:
numeric = false # disable name resolution
dns_cache = true # cache dns lookups (set to false to disable)
theme = "auto" # color theme: auto, dark, light, mono
[tui]
remember_state = false # remember view options between sessions
```
### remembering view options
when `remember_state = true`, the tui will save and restore:
- filter toggles (tcp/udp, listen/established/other)
- sort field and direction
- address and port resolution settings
state is saved to `$XDG_STATE_HOME/snitch/tui.json` (defaults to `~/.local/state/snitch/tui.json`).
cli flags always take priority over saved state.
### environment variables
```bash