Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions e2e/tasks/test_task_raw_output
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

# Test that raw tasks get interleave output even when task_output=prefix is set
# This ensures raw=true takes priority over task_output setting

cat <<EOF >mise.toml
[settings]
task_output = "prefix"

[tasks.normal]
run = 'echo normal task'

[tasks.raw_task]
raw = true
run = 'echo raw task output'
EOF

# Normal task should use prefix output (from settings)
assert_contains "mise run normal" "[normal] normal task"

# Raw task should get interleave output mode, meaning stdout goes directly
# without the [task_name] prefix being applied to the actual output
assert "mise run raw_task" "raw task output"

# Verify stdout doesn't have the prefix (only check stdout, not stderr)
stdout_output=$(mise run raw_task 2>/dev/null)
if [[ $stdout_output == *"[raw_task]"* ]]; then
echo "FAIL: raw task stdout should not have prefix"
exit 1
fi
echo "SUCCESS: raw task stdout has no prefix"
11 changes: 10 additions & 1 deletion src/task/task_output_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,21 @@ impl OutputHandler {
return TaskOutput::Quiet;
}

// CLI flags (--prefix, --interleave) override config settings
if self.prefix {
TaskOutput::Prefix
} else if self.interleave {
TaskOutput::Interleave
} else if let Some(output) = Settings::get().task_output {
output
// Silent/quiet from config override raw (output suppression takes precedence)
// Other modes (prefix, etc.) allow raw to take precedence for stdin/stdout
if output.is_silent() || output.is_quiet() {
output
} else if self.raw(task) {
TaskOutput::Interleave
} else {
output
}
} else if self.raw(task) || self.jobs() == 1 || self.is_linear {
TaskOutput::Interleave
} else {
Expand Down
Loading