upload comments
This commit is contained in:
parent
6ed02ea06a
commit
216df97453
|
@ -664,7 +664,7 @@ impl PluginInterface {
|
||||||
self.flush()
|
self.flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Send the plugin a ctrl-c signal.
|
/// Send the plugin a signal.
|
||||||
pub fn signal(&self, action: SignalAction) -> Result<(), ShellError> {
|
pub fn signal(&self, action: SignalAction) -> Result<(), ShellError> {
|
||||||
self.write(PluginInput::Signal(action))?;
|
self.write(PluginInput::Signal(action))?;
|
||||||
self.flush()
|
self.flush()
|
||||||
|
|
|
@ -310,7 +310,7 @@ impl RegisteredPlugin for PersistentPlugin {
|
||||||
// RAII guard that will be stored on the plugin.
|
// RAII guard that will be stored on the plugin.
|
||||||
let plugin = Arc::downgrade(&self);
|
let plugin = Arc::downgrade(&self);
|
||||||
handlers.register(Box::new(move |action| {
|
handlers.register(Box::new(move |action| {
|
||||||
// write a Ctrl-C packet through the PluginInterface if the plugin is alive and
|
// write a signal packet through the PluginInterface if the plugin is alive and
|
||||||
// running
|
// running
|
||||||
if let Some(plugin) = plugin.upgrade() {
|
if let Some(plugin) = plugin.upgrade() {
|
||||||
if let Ok(mutable) = plugin.mutable.lock() {
|
if let Ok(mutable) = plugin.mutable.lock() {
|
||||||
|
|
|
@ -525,8 +525,8 @@ impl EngineInterface {
|
||||||
self.state.writer.is_stdout()
|
self.state.writer.is_stdout()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Register a closure which will be called when the engine receives a Ctrl-C signal. Returns a
|
/// Register a closure which will be called when the engine receives an interrupt signal.
|
||||||
/// RAII guard that will keep the closure alive until it is dropped.
|
/// Returns a RAII guard that will keep the closure alive until it is dropped.
|
||||||
pub fn register_signal_handler(&self, handler: Handler) -> Result<HandlerGuard, ShellError> {
|
pub fn register_signal_handler(&self, handler: Handler) -> Result<HandlerGuard, ShellError> {
|
||||||
self.state.signal_handlers.register(handler)
|
self.state.signal_handlers.register(handler)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user