mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:36:00 +02:00
check signals in nu-glob
and ls
(#15140)
Fixes #10144 # User-Facing Changes Long running glob expansions and `ls` runs (e.g. `ls /**/*`) can now be interrupted with ctrl-c.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use nu_glob::MatchOptions;
|
||||
use nu_path::{canonicalize_with, expand_path_with};
|
||||
use nu_protocol::{shell_error::io::IoError, NuGlob, ShellError, Span, Spanned};
|
||||
use nu_protocol::{shell_error::io::IoError, NuGlob, ShellError, Signals, Span, Spanned};
|
||||
use std::{
|
||||
fs,
|
||||
path::{Component, Path, PathBuf},
|
||||
@ -19,6 +19,7 @@ pub fn glob_from(
|
||||
cwd: &Path,
|
||||
span: Span,
|
||||
options: Option<MatchOptions>,
|
||||
signals: Signals,
|
||||
) -> Result<
|
||||
(
|
||||
Option<PathBuf>,
|
||||
@ -90,7 +91,7 @@ pub fn glob_from(
|
||||
let pattern = pattern.to_string_lossy().to_string();
|
||||
let glob_options = options.unwrap_or_default();
|
||||
|
||||
let glob = nu_glob::glob_with(&pattern, glob_options).map_err(|e| {
|
||||
let glob = nu_glob::glob_with(&pattern, glob_options, signals).map_err(|e| {
|
||||
nu_protocol::ShellError::GenericError {
|
||||
error: "Error extracting glob pattern".into(),
|
||||
msg: e.to_string(),
|
||||
|
Reference in New Issue
Block a user