Repository navigation
fix(tui): honor CLI targets when launching interactive mode - #238
Merged
pranshuparmar merged 1 commit intoOct 3, 2026
Merged
Conversation
pranshuparmar
approved these changes
Oct 3, 2026
Merged
Owner
|
@chiliec Thanks for the contribution, available with https://github.com/pranshuparmar/witr/releases#release-v0.3.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #237.
witr -iignored every other flag:witr -p <pid> -iopened the TUI with nothing selected, and-o/-c/-f/ a process name had no effect on how interactive mode started.Interactive mode now receives the same ordered target list the non-interactive path builds and seeds the initial state from it:
-p <pid>— the row for that PID is selected (and its ancestry tree fetched) as soon as the first process list arrives.<name>— pre-fills the Processes filter.-o <port>— opens the Ports tab with the filter set.-c <container>— opens the Containers tab with the filter set.-f <file>— opens the Locks tab with the filter set (where the tab is available).When a non-Processes tab is opened,
Initalso kicks off that tab's refresh so the seeded filter has data to apply to. With no targets the behaviour is unchanged.Testing
go build ./...,go vet ./internal/tui ./internal/app,gofmt -l internal/clean.TestWithTargetsSeedsInitialStateininternal/tui/update_test.gocovers pid selection on the first[]model.Processmessage (cursor lands on the right row, tree fetch command returned, seed cleared), name filter narrowing, port tab + filter narrowing the port table, container tab + filter, and the no-target default.go test ./...— all packages pass.witr -i nginxopens with> nginxin the filter box;witr -i -p 1opens with PID 1 highlighted and its ancestry in the side panel.