mirror of
https://github.com/nushell/nushell
synced 2025-01-16 23:24:14 +00:00
c371d1a535
# Description Fixes: #11394 When run `^sleep 3` we have an `exit_code ListStream`, and when we press ctrl-c, this `ListStream` will return None. But it's not expected, because `exit_code` sender in `run_external` always send an exit code out. This pr is trying to fix the issue by introducing a `first_guard` into ListStream, it will always generate a value from underlying stream if `first_guard` is true, so it's guarantee to have at least one value to return. And the pr also do a little refactor, which makes use of `ListStream::from_stream` rather than construct it manually. # User-Facing Changes ## Before ``` > nu -c "^sleep 3" # press ctrl-c > echo $env.LAST_EXIT_CODE 0 ``` ## After ``` > nu -c "^sleep 3" # press ctrl-c > echo $env.LAST_EXIT_CODE 255 ``` # Tests + Formatting None, sorry that I don't think it's easy to test the ctrlc behavior. # After Submitting None |
||
---|---|---|
.. | ||
ast | ||
config | ||
engine | ||
value | ||
alias.rs | ||
cli_error.rs | ||
did_you_mean.rs | ||
eval_base.rs | ||
eval_const.rs | ||
example.rs | ||
exportable.rs | ||
id.rs | ||
lev_distance.rs | ||
lib.rs | ||
module.rs | ||
parse_error.rs | ||
parse_warning.rs | ||
pipeline_data.rs | ||
plugin_signature.rs | ||
shell_error.rs | ||
signature.rs | ||
span.rs | ||
syntax_shape.rs | ||
ty.rs | ||
util.rs | ||
variable.rs |