Skip to content

Value::List and Value::Range can be interrupted when piping to other commands.#17245

Merged
WindSoilder merged 3 commits intonushell:mainfrom
WindSoilder:push-kkzwlmskrsyt
Dec 30, 2025
Merged

Value::List and Value::Range can be interrupted when piping to other commands.#17245
WindSoilder merged 3 commits intonushell:mainfrom
WindSoilder:push-kkzwlmskrsyt

Conversation

@WindSoilder
Copy link
Copy Markdown
Contributor

Fixes: #14862
This issue is happened when creating Iterator from List/Range value, the signal is set to Signals::empty, which is unwanted behavior because Singal::empty can'e be interruped.

To fix it, we need to make List/Range carries a signal from engine_state.signals. I did this by:

  1. introducing signals fields to Value::List/Value::Range
  2. before running a command, manually inject_signals to the value.

To be honest the implementation is not really good, not sure if there is a better way to do this :-(

Release notes summary - What our users need to know

Infinite sequences cant be terminated when piped to other command

> `1..inf | to md`  # then press ctrl-c
^CError: nu::shell::error

  × Operation interrupted
   ╭─[entry #1:1:1]
 1 │ 1..inf | to md
   · ───────┬──────
   ·        ╰── This operation was interrupted
   ╰────

@WindSoilder WindSoilder force-pushed the push-kkzwlmskrsyt branch 2 times, most recently from 4c2e97b to 0630e1b Compare December 27, 2025 15:17
Fix CI failure after nushell#17237
I don't know how can it happened, but it seems that `rm -f` inside tests
should fix the problem.

## Release notes summary - What our users need to know
NaN

## Tasks after submitting
@github-actions github-actions bot added the A:std-library Defining and improving the standard library written in Nu label Dec 28, 2025
@WindSoilder WindSoilder added notes:fixes Include the release notes summary in the "Bug fixes" section notes:ready The "Release notes summary" section of this PR is ready to be included in our release notes. labels Dec 28, 2025
@WindSoilder WindSoilder merged commit 70d5e76 into nushell:main Dec 30, 2025
16 checks passed
@github-actions github-actions bot added this to the v0.110.0 milestone Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:std-library Defining and improving the standard library written in Nu notes:fixes Include the release notes summary in the "Bug fixes" section notes:ready The "Release notes summary" section of this PR is ready to be included in our release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite sequences cant be terminated when piped to to ... command.

1 participant