You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add watch mode for auto-refreshing diffs (#96)
## Summary
When working on a branch, it's useful to leave diffnav open in a
terminal tab and have it automatically reflect the latest changes. This
adds `--watch` mode, which periodically re-runs a diff command and
refreshes the TUI.
```sh
diffnav --watch
diffnav --watch --watch-cmd "git diff main..." --watch-interval 5s
```
## Details
- New flags: `--watch` (`-w`), `--watch-cmd` (default: `git diff`),
`--watch-interval` (default: `2s`)
- Watch tick/result message loop with in-flight guard to prevent
overlapping fetches
- Stderr discarded in watch command execution to avoid corrupting the
TUI
- `ClearCache` on diffviewer for clean re-renders on refresh
- Active watch command shown in footer bar
- README updated with watch mode flags and usage examples
---------
Co-authored-by: Dolev Hadar <dolevc2@gmail.com>
0 commit comments