-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Error on out> redirect on branched block #16582
Copy link
Copy link
Closed
Labels
A:ir-compilerIssues/pull requests related to compiling Nushell parser output to internal representation (IR)Issues/pull requests related to compiling Nushell parser output to internal representation (IR)A:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRAll related to redirection to files or more complex pipelines with STDERRcategory:bugSomething isn't workingSomething isn't working
Description
Running an output redirect (eg out> /dev/null) after a conditional block gives the following error:
Error: nu::shell::ir_eval_error
× IR evaluation error: Tried to write to file #0, but it is not open
╭─[entry #286:1:36]
1 │ if true {echo hey} else { echo ho} o> /dev/null
· ─┬
· ╰── while running this code
╰────
help: this is a bug, please report it...
Note that the file does get created and written to, even when the error occurs.
The simplest code for reproduction is: if true { echo hey } out> /dev/null
Note that the same issue exists for try { 1/0 } catch { 'ono' } o> /dev/null
This is observed on nu --version = 0.105.1 (on nixos installation).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:ir-compilerIssues/pull requests related to compiling Nushell parser output to internal representation (IR)Issues/pull requests related to compiling Nushell parser output to internal representation (IR)A:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRAll related to redirection to files or more complex pipelines with STDERRcategory:bugSomething isn't workingSomething isn't working