From 08f5c3b01432aca5b5edae3c55a7af9d517632b3 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 9 Mar 2026 08:56:24 -0400 Subject: [PATCH 1/2] fix(task): include args in task output prefix and truncate long prefixes When the same task runs multiple times with different arguments (e.g. as dependencies in a test matrix), all output was prefixed with just the task name, making it impossible to distinguish runs. Now args are included in the prefix (e.g. `[test-docker 4.1]`) and long prefixes are truncated to 40 chars. Closes https://github.com/jdx/mise/discussions/8531 Co-Authored-By: Claude Opus 4.6 --- src/task/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/task/mod.rs b/src/task/mod.rs index 2b66684355..30eab7f958 100644 --- a/src/task/mod.rs +++ b/src/task/mod.rs @@ -516,7 +516,10 @@ impl Task { } pub fn prefix(&self) -> String { - format!("[{}]", self.display_name) + let max_width = 40; + let inner = format!("{} {}", self.display_name, self.args.join(" ")); + let inner = inner.trim(); + format!("[{}]", console::truncate_str(inner, max_width, "…")) } pub fn run(&self) -> &Vec { From f72a6e78c1925af4b6ab4fae11e79280f91dd685 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 9 Mar 2026 09:12:59 -0400 Subject: [PATCH 2/2] fix(task): update e2e tests for new prefix format with args --- e2e/tasks/test_task_double_dash_behavior | 2 +- e2e/tasks/test_task_run_depends | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/tasks/test_task_double_dash_behavior b/e2e/tasks/test_task_double_dash_behavior index ddfe41d284..671e32ccbc 100644 --- a/e2e/tasks/test_task_double_dash_behavior +++ b/e2e/tasks/test_task_double_dash_behavior @@ -54,7 +54,7 @@ EOF # Usage spec handles its own flags (parsed by usage spec, not passed as $@) # shellcheck disable=SC2016 -assert "mise run with_usage -x myfile 2>&1" '[with_usage] $ echo "custom=$usage_custom file=$usage_file args=$@" +assert "mise run with_usage -x myfile 2>&1" '[with_usage -x myfile] $ echo "custom=$usage_custom file=$usage_file args=$@" custom=true file=myfile args=' # But mise flags still go to mise (myfile is consumed by usage spec, not passed to $@) diff --git a/e2e/tasks/test_task_run_depends b/e2e/tasks/test_task_run_depends index 5652dc6f9f..b6f21f2ff8 100644 --- a/e2e/tasks/test_task_run_depends +++ b/e2e/tasks/test_task_run_depends @@ -6,9 +6,9 @@ run = 'echo build' [tasks.all] depends = ['build a', 'build b', 'build c'] EOF -assert "mise run all | sort" "[build] build a -[build] build b -[build] build c" +assert "mise run all | sort" "[build a] build a +[build b] build b +[build c] build c" cat <mise.toml [tasks.build1]