k9s/internal
tyzbit 548536e40d
fix(history): handle cases where special commands add their command to the stack (#3168)
Fixes #3166

Throughout the code, pushCmd is used for when a command is being executed (switched to) to conditionally add the new command onto the history. The history commands (keybinds `[`, `]`, `-`) only navigate through the stack with indices and therefore should never manipulate the stack -- however with some special commands (specialCmd), navigating to those commands previously unconditionally added the command to the stack unlike "typical" commands like `pods`, `svc`.

Here we pass in the pushCmd boolean to all appropriate special commands so that if the stack should not be manipulated, they do not push their command onto the stack.

The original issue reported issues with Aliases, but there were unreported bugs with Namespaces and Contexts as well. Notably, RBAC commands and Dir commands were not modified as they do not push their command onto the history stack, functioning more as "virtual" commands that will not appear in the history.
2025-03-07 07:32:34 -07:00
..
client Rel 0.40.5 (#3136) 2025-02-18 08:47:33 -07:00
color Rel v0.32.7 (#2971) 2024-11-16 13:21:23 -07:00
config Rel 0.40.5 (#3136) 2025-02-18 08:47:33 -07:00
dao Rel 0.40.5 (#3136) 2025-02-18 08:47:33 -07:00
health Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
model [hotfix] rel v0.40.2 2025-02-16 20:45:52 -07:00
model1 Rel v0.40.4 (#3130) 2025-02-17 23:27:56 -07:00
perf K9s/rel v0.30.0 (#2361) 2023-12-23 14:29:55 -07:00
port K9s/rel v0.30.0 (#2361) 2023-12-23 14:29:55 -07:00
render Rel 0.40.5 (#3136) 2025-02-18 08:47:33 -07:00
tchart Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
ui Rel v0.40.4 (#3130) 2025-02-17 23:27:56 -07:00
view fix(history): handle cases where special commands add their command to the stack (#3168) 2025-03-07 07:32:34 -07:00
vul Rel v0.40.0 (#3109) 2025-02-15 15:33:33 -07:00
watch allow scaling custom resource (#2833) 2025-02-16 10:46:47 -07:00
xray Release v0.32.6 (#2955) 2024-11-10 10:08:54 -07:00
helpers.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
helpers_test.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
keys.go K9s Release v0.29.0 (#2326) 2023-12-06 23:12:39 -07:00