nushell/crates/nu-cmd-extra
Simon Curtis f05162811c
Implementing ByteStream interuption on infinite stream (#13552)
# Description

This PR should address #13530 by explicitly handling ByteStreams. 

The issue can be replicated easily on linux by running:

```nushell
open /dev/urandom | into binary | bytes at ..10
```

Would leave the output hanging and with no way to cancel it, this was
likely because it was trying to collect the input stream and would not
complete.

I have also put in an error to say that using negative offsets for a
bytestream without a length cannot be used.

```nushell
~/git/nushell> open /dev/urandom | into binary | bytes at (-1)..
Error: nu:🐚:incorrect_value

  × Incorrect value.
   ╭─[entry #3:1:35]
 1 │ open /dev/urandom | into binary | bytes at (-1)..
   ·                                   ────┬─── ───┬──
   ·                                       │       ╰── encountered here
   ·                                       ╰── Negative range values cannot be used with streams that don't specify a length
   ╰────
   ```

# User-Facing Changes

No operation changes, only the warning you get back for negative offsets

# Tests + Formatting

Ran `toolkit check pr ` with no errors or warnings

Manual testing of the example commands above

---------

Co-authored-by: Ian Manske <ian.manske@pm.me>
Co-authored-by: Simon Curtis <simon.curtis@candc-uk.com>
2025-01-11 13:28:08 -08:00
..
assets REFACTOR: move the 0% commands to nu-cmd-extra (#9404) 2023-07-06 08:31:31 -07:00
src Implementing ByteStream interuption on infinite stream (#13552) 2025-01-11 13:28:08 -08:00
tests Rename/deprecate into bits to format bits (#14634) 2024-12-28 22:49:25 +01:00
Cargo.toml Bump version to 0.101.1 (#14661) 2024-12-24 23:47:00 +01:00
LICENSE nu-cmd-extra crate infrastructure in place with the Bits command as the model for adding other commands (#9327) 2023-06-01 10:46:16 -07:00
README.md Remove feat extra and include in default (#12140) 2024-03-10 17:29:02 +01:00

nu-cmd-extra

The commands in this crate are the extra commands of Nushell. These commands are not in a state to be guaranteed to be part of the 1.0 API; meaning that there is no guarantee longer term that these commands will be around into the future.

For a while we did exclude them behind the --features extra compile time flag, meaning that the default release did not contain them. As we (the Nushell team) shipped a full build including both extra and dataframe for some time, we chose to sunset the extra feature but keep the commands in this crate for now. In the future the commands may be moved to more topical crates or discarded into plugins.