mirror of
https://github.com/nushell/nushell.git
synced 2025-05-05 10:34:27 +02:00
# Description This is an attempt to improve the nushell situation with regard to issue #247. This PR implements: - [X] spawning jobs: `job spawn { do_background_thing }` Jobs will be implemented as threads and not forks, to maintain a consistent behavior between unix and windows. - [X] listing running jobs: `job list` This should allow users to list what background tasks they currently have running. - [X] killing jobs: `job kill <id>` - [X] interupting nushell code in the job's background thread - [X] interrupting the job's currently-running process, if any. Things that should be taken into consideration for implementation: - [X] (unix-only) Handling `TSTP` signals while executing code and turning the current program into a background job, and unfreezing them in foreground `job unfreeze`. - [X] Ensuring processes spawned by background jobs get distinct process groups from the nushell shell itself This PR originally aimed to implement some of the following, but it is probably ideal to be left for another PR (scope creep) - Disowning external process jobs (`job dispatch`) - Inter job communication (`job send/recv`) Roadblocks encountered so far: - Nushell does some weird terminal sequence magics which make so that when a background process or thread prints something to stderr and the prompt is idle, the stderr output ends up showing up weirdly
29 lines
669 B
Rust
29 lines
669 B
Rust
#![doc = include_str!("../README.md")]
|
|
mod call_ext;
|
|
mod closure_eval;
|
|
pub mod column;
|
|
pub mod command_prelude;
|
|
mod compile;
|
|
pub mod documentation;
|
|
pub mod env;
|
|
mod eval;
|
|
mod eval_helpers;
|
|
mod eval_ir;
|
|
pub mod exit;
|
|
mod glob_from;
|
|
pub mod scope;
|
|
|
|
pub use call_ext::CallExt;
|
|
pub use closure_eval::*;
|
|
pub use column::get_columns;
|
|
pub use compile::compile;
|
|
pub use documentation::get_full_help;
|
|
pub use env::*;
|
|
pub use eval::{
|
|
eval_block, eval_block_with_early_return, eval_call, eval_expression,
|
|
eval_expression_with_input, eval_subexpression, eval_variable, redirect_env,
|
|
};
|
|
pub use eval_helpers::*;
|
|
pub use eval_ir::eval_ir_block;
|
|
pub use glob_from::glob_from;
|