nushell/src
Renan Ribeiro 9bb7f0c7dc
Jobs (#14883)
# 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
2025-02-25 12:09:52 -05:00
..
command_context.rs Refactor/fix tests affecting the whole command set (#15073) 2025-02-11 11:36:36 +01:00
command.rs Fix quoting in to nuon and refactor quoting functions (#14180) 2024-10-29 07:43:26 -05:00
config_files.rs Convert Path to list in main and preserve case (#14764) 2025-01-10 10:18:44 -06:00
ide.rs More precise ErrorKind::NotFound errors (#15149) 2025-02-22 11:42:44 -05:00
logger.rs Add options for filtering the log output from nu (#13044) 2024-06-05 16:42:55 +08:00
main.rs Jobs (#14883) 2025-02-25 12:09:52 -05:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
run.rs Convert Path to list in main and preserve case (#14764) 2025-01-10 10:18:44 -06:00
signals.rs fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
terminal.rs Deduplicate nix dependency versions (#12307) 2024-03-27 16:43:37 +01:00
test_bins.rs Make Hooks fields non-optional to match the new config defaults (#14345) 2024-11-29 21:11:09 +00:00

Nushell REPL

This directory contains the main Nushell REPL (read eval print loop) as part of the CLI portion of Nushell, which creates the nu binary itself.

Current versions of the nu binary will use the Nu argument parsing logic to parse the commandline arguments passed to nu, leaving the logic here to be a thin layer around what the core libraries.