Feature request: browse context history
kubectx -
which is documented here
I: kubectx -h
USAGE:
kubectx : list the contexts
kubectx <NAME> : switch to context <NAME>
kubectx - : switch to the previous context
kubectx -c, --current : show the current context name
...
Is great for switching to the previous context. What I would like is to be able to see the previous n contexts and choose between them. Perhaps a new flag could be created something like kubectx --history?
For my own personal use I plan to set it up to have kubectx or an alias default to this most recent ordering (contexts not in the history at all would come last)
Open to other suggestions / workarounds as well!
Why not just use your shell history (Ctrl+R) like you would for any other command, like "cd" or "git checkout"?
Or are you only proposing we change the ordering that we present to the interactive selection (the fzf command)?
Hi @ahmetb
When I use kubectx with fzf, the only entry in my shells history file is kubectx, so Ctrl r won't work
I'm just proposing some way that kubectx could show users their recent contexts. I was just trying to give motivation for how I would use it.