nushell/crates/nu-utils/src
Reilly Wood e215fbbd08
Add helper method to check whether ctrl+c was pressed, adopt it (#7482)
I've been working on streaming and pipeline interruption lately. It was
bothering me that checking ctrl+c (something we want to do often) always
requires a bunch of boilerplate like:
```rust
use std::sync::atomic::Ordering;

if let Some(ctrlc) = &engine_state.ctrlc {
     if ctrlc.load(Ordering::SeqCst) {
          ...
```
I added a helper method to cut that down to:

```rust
if nu_utils::ctrl_c::was_pressed(&engine_state.ctrlc) {
    ...
```
2022-12-15 09:39:24 -08:00
..
sample_config add missing shapes to default_config (#7472) 2022-12-14 07:11:17 -06:00
ctrl_c.rs Add helper method to check whether ctrl+c was pressed, adopt it (#7482) 2022-12-15 09:39:24 -08:00
deansi.rs Refactor ansi stripping into nu-utils functions (#6966) 2022-11-05 07:49:45 +13:00
lib.rs Add helper method to check whether ctrl+c was pressed, adopt it (#7482) 2022-12-15 09:39:24 -08:00
locale.rs make date format supports locale (#6306) 2022-08-14 08:07:04 -05:00
main.rs added nu-utils crate, fixed issue where externals turn off vt processing (#4857) 2022-03-16 17:21:06 -05:00
utils.rs adds a config reset command (#6149) 2022-07-31 20:44:33 -05:00