Skip to content

Commit 2df3570

Browse files
committed
Saving should always default to --tui
1 parent 32e00e9 commit 2df3570

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ fn main() -> Result<()> {
167167
}
168168

169169
// Resolve the build command: explicit > saved > stdin
170+
let mut using_saved = false;
170171
let cmd: Vec<String> = if !args.cmd.is_empty() {
171172
args.cmd.clone()
172173
} else if let Some(saved) = load_command()? {
173174
eprintln!("bx: using saved command: {}", saved.join(" "));
175+
using_saved = true;
174176
saved
175177
} else {
176178
Vec::new() // will fall through to stdin check below
@@ -202,7 +204,10 @@ fn main() -> Result<()> {
202204

203205
let blocks = collect_blocks(&raw, context_limit, &patterns);
204206

205-
if args.tui {
207+
// Default to TUI when running a saved command with no explicit mode flag.
208+
// If the user passed --tui explicitly, or is using a saved command, open TUI.
209+
let use_tui = args.tui || using_saved;
210+
if use_tui {
206211
let shown: Vec<_> = blocks.into_iter().filter(|b| {
207212
b.severity.is_error() || (args.warnings && !b.severity.is_error())
208213
}).collect();

0 commit comments

Comments
 (0)