nushell/crates/nu-cli/src
Ian Manske 399a7c8836
Add and use new Signals struct (#13314)
# Description
This PR introduces a new `Signals` struct to replace our adhoc passing
around of `ctrlc: Option<Arc<AtomicBool>>`. Doing so has a few benefits:
- We can better enforce when/where resetting or triggering an interrupt
is allowed.
- Consolidates `nu_utils::ctrl_c::was_pressed` and other ad-hoc
re-implementations into a single place: `Signals::check`.
- This allows us to add other types of signals later if we want. E.g.,
exiting or suspension.
- Similarly, we can more easily change the underlying implementation if
we need to in the future.
- Places that used to have a `ctrlc` of `None` now use
`Signals::empty()`, so we can double check these usages for correctness
in the future.
2024-07-07 22:29:01 +00:00
..
commands Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
completions Fix variable completion sort order (#13306) 2024-07-05 17:58:35 -05:00
menus Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
config_files.rs Converted perf function to be a macro. Utilized the perf macro within the polars plugin. (#13224) 2024-06-27 18:56:56 -05:00
eval_cmds.rs Change the error style during tests to plain (#13061) 2024-06-18 21:37:24 -07:00
eval_file.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
lib.rs Change the error style during tests to plain (#13061) 2024-06-18 21:37:24 -07:00
nu_highlight.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
print.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
prompt_update.rs Refactor the CLI code a bit (#12782) 2024-05-10 07:29:27 +08:00
prompt.rs cleanup osc calls for shell_integration (#12810) 2024-05-08 13:34:04 -05:00
reedline_config.rs Fix delta not being merged when evaluating menus (#13120) 2024-06-10 22:33:22 +03:00
repl.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
syntax_highlight.rs Revert "Span ID Refactor (Step 2): Make Call SpanId-friendly (#13268)" (#13292) 2024-07-04 00:02:13 +03:00
util.rs Converted perf function to be a macro. Utilized the perf macro within the polars plugin. (#13224) 2024-06-27 18:56:56 -05:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00