From d21ed0fb221152645881a3ac268c4ebfd4e379ec Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 31 Jul 2024 23:32:30 +0200 Subject: [PATCH] Disable terminal protocols before expanding wildcards Commit 29f2da8d1 (Toggle terminal protocols lazily, 2024-05-16) made it so the wildcard expansion in "echo **" (in a large directory tree) can't be canceled with ctrl-c. Fix this by disabling terminal protocols already at expansion time (not waiting until execution). --- src/wildcard.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wildcard.rs b/src/wildcard.rs index 5900bc436..9c9be1572 100644 --- a/src/wildcard.rs +++ b/src/wildcard.rs @@ -448,7 +448,9 @@ mod expander { use crate::{ common::scoped_push, + input_common::terminal_protocols_disable_ifn, path::append_path_component, + threads::is_main_thread, wutil::{dir_iter::DirIter, normalize_path, DevInode}, }; @@ -592,6 +594,10 @@ mod expander { } } + if is_main_thread() { + terminal_protocols_disable_ifn(); + } + // return "." and ".." entries if we're doing completions let Ok(mut dir) = self.open_dir( base_dir, /* return . and .. */