mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 13:51:01 +02:00
@ -75,6 +75,8 @@ pub struct EngineState {
|
||||
pub config: Config,
|
||||
#[cfg(feature = "plugin")]
|
||||
pub plugin_signatures: Option<PathBuf>,
|
||||
#[cfg(not(windows))]
|
||||
sig_quit: Option<Arc<AtomicBool>>,
|
||||
}
|
||||
|
||||
pub const NU_VARIABLE_ID: usize = 0;
|
||||
@ -106,6 +108,8 @@ impl EngineState {
|
||||
config: Config::default(),
|
||||
#[cfg(feature = "plugin")]
|
||||
plugin_signatures: None,
|
||||
#[cfg(not(windows))]
|
||||
sig_quit: None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -713,6 +717,21 @@ impl EngineState {
|
||||
|
||||
self.num_files() - 1
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn get_sig_quit(&self) -> &Option<Arc<AtomicBool>> {
|
||||
&self.sig_quit
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn get_sig_quit(&self) -> &Option<Arc<AtomicBool>> {
|
||||
&None
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn set_sig_quit(&mut self, sig_quit: Arc<AtomicBool>) {
|
||||
self.sig_quit = Some(sig_quit)
|
||||
}
|
||||
}
|
||||
|
||||
/// A temporary extension to the global state. This handles bridging between the global state and the
|
||||
|
Reference in New Issue
Block a user