k9s/internal/view
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
..
cmd fix(history): handle cases where special commands add their command to the stack (#3168) 2025-03-07 07:32:34 -07:00
testdata checkpoint 2020-10-26 16:49:28 -06:00
actions.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
actions_test.go K9s/release v0.31.8 (#2528) 2024-02-06 19:21:28 -07:00
alias.go Pass grv on gotoResource as a String (#3149) 2025-02-23 10:50:50 -07:00
alias_test.go Rel v0.40.0 (#3109) 2025-02-15 15:33:33 -07:00
app.go fix(history): handle cases where special commands add their command to the stack (#3168) 2025-03-07 07:32:34 -07:00
app_test.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
benchmark.go K9s/release v0.30.3 (#2381) 2023-12-25 12:06:23 -07:00
browser.go Rel v0.40.4 (#3130) 2025-02-17 23:27:56 -07:00
cluster_info.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
cm.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
cm_test.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
command.go fix(history): handle cases where special commands add their command to the stack (#3168) 2025-03-07 07:32:34 -07:00
container.go Release v0.32.6 (#2955) 2024-11-10 10:08:54 -07:00
container_test.go Release v0.32.6 (#2955) 2024-11-10 10:08:54 -07:00
context.go Dialog boxes use dialog style (#2150) 2025-01-12 09:27:49 -07:00
context_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
cow.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
crd.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
cronjob.go Dialog boxes use dialog style (#2150) 2025-01-12 09:27:49 -07:00
details.go K9s/release v0.32.4 (#2637) 2024-03-20 13:14:37 -06:00
dir.go Rel v0.40.0 (#3109) 2025-02-15 15:33:33 -07:00
dir_int_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
dir_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
dp.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
dp_test.go allow scaling custom resource (#2833) 2025-02-16 10:46:47 -07:00
drain_dialog.go Rename "delete local data" checkbox description in drain dialog (#3060) 2025-02-01 08:53:54 -07:00
ds.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
ds_test.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
env.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
env_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
event.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
exec.go Fix K9S_EDITOR (#3043) 2025-01-08 11:14:57 -07:00
group.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
helm_chart.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
helm_history.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
help.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
help_test.go allow jumping to the owner of the resource (#2700) 2024-05-18 08:49:41 -06:00
helpers.go k9s doesn't honor KUBECONFIG environment variable when replacing value for plugin (#2862) 2024-11-28 11:21:03 -07:00
helpers_test.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
image_extender.go Dialog boxes use dialog style (#2150) 2025-01-12 09:27:49 -07:00
img_scan.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
job.go allow jumping to the owner of the resource (#2700) 2024-05-18 08:49:41 -06:00
live_view.go Fix typos (#3026) 2024-12-16 09:09:22 -07:00
live_view_test.go K9s/rel v0.30.0 (#2361) 2023-12-23 14:29:55 -07:00
log.go Fix lint build (#3066) 2025-01-19 09:47:29 -07:00
log_indicator.go Feature/DisableAutoscroll (#2865) 2025-02-15 17:36:15 -07:00
log_indicator_test.go K9s/release v0.30.1 (#2369) 2023-12-24 11:29:22 -07:00
log_int_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
log_test.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
logger.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
logs_extender.go K9s/release v0.32.4 (#2637) 2024-03-20 13:14:37 -06:00
node.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
ns.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
ns_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
owner_extender.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
page_stack.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
pf.go Fix lint build (#3066) 2025-01-19 09:47:29 -07:00
pf_dialog.go K9s/release v0.32.1 (#2591) 2024-03-04 17:57:20 -07:00
pf_dialog_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
pf_extender.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
pf_extender_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
pf_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
picker.go fix: properly initialize key actions in picker (#2586) 2024-03-04 13:56:38 -07:00
pod.go Fix typos (#3026) 2024-12-16 09:09:22 -07:00
pod_int_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
pod_test.go allow jumping to the owner of the resource (#2700) 2024-05-18 08:49:41 -06:00
policy.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
popeye.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
priorityclass.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
priorityclass_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
pulse.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
pvc.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
pvc_test.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
rbac.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
rbac_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
reference.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
reference_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
registrar.go Rel v0.40.0 (#3109) 2025-02-15 15:33:33 -07:00
restart_extender.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
rs.go Dialog boxes use dialog style (#2150) 2025-01-12 09:27:49 -07:00
sa.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
sanitizer.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
scale_extender.go allow scaling custom resource (#2833) 2025-02-16 10:46:47 -07:00
screen_dump.go K9s/release v0.31.0 (#2440) 2024-01-08 18:30:49 -07:00
screen_dump_test.go Clean up items... (#2303) 2023-11-19 08:43:39 -07:00
secret.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
secret_test.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
sts.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
sts_test.go allow scaling custom resource (#2833) 2025-02-16 10:46:47 -07:00
svc.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
svc_test.go enable "jump to owner" for more kinds (#2763) 2024-08-15 18:10:03 -06:00
table.go Rel v0.40.0 (#3109) 2025-02-15 15:33:33 -07:00
table_helper.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
table_int_test.go Rel v0.40.0 (#3109) 2025-02-15 15:33:33 -07:00
types.go fix view sorting being reset (#2736) 2024-06-15 09:03:13 -06:00
user.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
value_extender.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
vul_extender.go K9s/release v0.32.0 (#2577) 2024-03-02 10:18:47 -07:00
workload.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
xray.go feat(app): add history navigation with `[` and `]`, most recent command with `-` (#2799) 2025-02-15 17:40:29 -07:00
yaml.go fix: Avoid false positive matches in enableRegion (#3093) (#3140) 2025-02-23 18:12:18 -07:00
yaml_test.go fix: Avoid false positive matches in enableRegion (#3093) (#3140) 2025-02-23 18:12:18 -07:00