Repository navigation
fix(cmd): keep the -f flag when a command line is rebuilt - #4356
Merged
Merged
Conversation
args.String() wrote the fuzzy filter value without its -f flag, so Interpreter.Merge turned `pod -f fred` into `pod fred`. Command.run merges the interpreter and then calls SwitchNS, which re-parses the line, so `fred` was read back as a namespace, the active namespace replaced it, and FuzzyArg() came back empty: `:pod -f fred` lost its fuzzy filter, and the history entry read `v1/pods fred default`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
uozalp
approved these changes
Nov 3, 2026
uozalp
left a comment
Collaborator
There was a problem hiding this comment.
@b84330808 Thanks for the update
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.
:pod -f freddrops its fuzzy filter.args.String()writes the fuzzy value without its-fflag, soInterpreter.Mergeturnspod -f fredintopod fred.Command.runthen callsSwitchNS, which re-parses the line:fredis read back as a namespace, the active namespace replaces it, andFuzzyArg()returns nothing. The history entry ends up asv1/pods fred default.This writes the fuzzy value back as
-f <value>, like the filter and context values next to it.TestMergeKeepsFuzzyFilterrunsMergeandSwitchNSonpod -f fred,pod -ffredand a namespace switch. Before the change it fails (expected: "pod -f fred",actual : "pod fred", andFuzzyArg()empty); after it, it passes, andgo test ./internal/view/cmd/ ./internal/view/passes.Fixes #4354
I used Claude Code to write this change.