check signals while printing values#14980
Merged
132ikl merged 1 commit intonushell:mainfrom Feb 7, 2025
sgvictorino:print-interruption
Merged
check signals while printing values#14980132ikl merged 1 commit intonushell:mainfrom sgvictorino:print-interruption
132ikl merged 1 commit intonushell:mainfrom
sgvictorino:print-interruption
Conversation
Member
|
thanks! i'd like to take a closer look at this when I get the chance |
132ikl
reviewed
Feb 3, 2025
Member
132ikl
left a comment
There was a problem hiding this comment.
thanks! a couple quick thoughts here. I'm all for getting this into the release if possible.
also, I checked throughput of printing to stdout and it doesn't seem to be affected by this. great job!
Fixes #14960 # User-Facing Changes - The output of non-streaming values can now be interrupted with ctrl-c: ```nushell ~> use std repeat; random chars --length 100kb | repeat 2000 | str join ' ' | collect <data omitted>^C Error: × Operation interrupted ╭─[entry #1:1:61] 1 │ use std repeat; random chars --length 100kb | repeat 2000 | str join ' ' | collect · ────┬─── · ╰── This operation was interrupted ╰──── ``` - When IO errors occur while printing data, nushell no longer panics: ```diff $ nu -c "true | print" | - -Error: - x Main thread panicked. - |-> at crates/nu-protocol/src/errors/shell_error/io.rs:198:13 - `-> for unknown spans with paths, use `new_internal_with_path` +Error: nu:🐚:io::broken_pipe + + x I/O error + `-> x Broken pipe + + ,-[source:1:1] + 1 | true | print + : ^^|^ + : `-| Writing to stdout failed + : | Broken pipe + `---- ```
Member
|
lgtm, thank you! I think we might be doing a patch release(?) so I won't merge this quite yet, but we should be good to go on this once we're ready to merge again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14960
User-Facing Changes