mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 13:11:15 -03:00
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).
This commit is contained in:
@@ -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 @@ pub fn expand(&mut self, base_dir: &wstr, wc: &wstr, effective_prefix: &wstr) {
|
||||
}
|
||||
}
|
||||
|
||||
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 .. */
|
||||
|
||||
Reference in New Issue
Block a user