You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
open --raw with multiple files splits contents into chunks of 8KB #10027
A:file-systemRelated to commands and core nushell behavior around the file systemA:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRA:streamingIssues related to streaming data (or collecting data when it should be streamed)category:bugSomething isn't working
If open --raw is used with a multiple files, the files are chunked into chunks of 8192 bytes (8KB). This seems like unintuitive behaviour. The behaviour I expected was to get was a list with an element per file.
👍 that we should stream out. The BufReader may be fine if other parts of the system expect the whole stream to be understood as one value. It seems that we're treating each chunk from the stream separately.
This is a wild bug that I think I've just run into as well — no --raw needed for these files (I'd imagine because Nushell doesn't natively read .jsonl):
Thank you for sharing those examples. I am also experiencing this issue
where open seems to be splitting files into 8KB chunks when handling
multiple files simultaneously. Your workaround using each { open } is
helpful for now, but it definitely confirms there is an underlying bug in
how Nushell handles multiple file inputs.
On Thu, Apr 9, 2026, 8:32 AM Brooks Rady ***@***.***> wrote:
*TheLostLambda* left a comment (nushell/nushell#10027)
<#10027 (comment)>
This is a wild bug that I think I've just run into as well — no --raw
needed for these files (I'd imagine because Nushell doesn't natively read
.jsonl):
❯ open assembly_data_report1.jsonl assembly_data_report2.jsonl | str length
╭───┬──────╮
│ 0 │ 4004 │
│ 1 │ 8192 │
│ 2 │ 560 │
╰───┴──────╯
It's splitting the second file there, but if you load one file at a time:
❯ open assembly_data_report2.jsonl | str length8752
# Or even:
❯ [assembly_data_report1.jsonl assembly_data_report2.jsonl] | each { open | str length}
╭───┬──────╮
│ 0 │ 4004 │
│ 1 │ 8752 │
╰───┴──────╯
—
Reply to this email directly, view it on GitHub
<#10027 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B74G4LNJ3YWFIIQYSCXJLY34U6Q7HAVCNFSM6AAAAACXSSAANWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEMJUGYZTMMJYGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
if you search the code base for 8192 you'll find that it's a buffer size and an output chunk size. i suspect this has something to do with the problem. sophia talks about needing to stream above.
For everyone here, to get a final check on some chatting we were doing on the Discord, would people be okay with open --raw Cargo.toml LICENSE returning a single, concatenated string (like it returns concatenated tables), and if you want the current behaviour (returning a list of strings, but without the chunking, which I've identified the source of) you can pipe a list in? Like [Cargo.toml LICENSE] | open.
By default then, --raw or not, open x y acts just like cat x y, sticking things together, and if you want a list out, you can give it a list in: [x y] | open. I feel something like that would make open more consistent and predictable!
This is what I said in Discord already. Working like cat is not the goal. Working like nushell is the goal. 4 works like 1 except that it gets passed through from ext.
Trying to help answer your question here so you can make some progress.
open -raw file1 file2 file3 should produce a raw byte stream. i think this is similar to cat
open file.recognized_extension should work the way it does today except not be hampered by 8192 bytes truncating things. streaming would be great.
for now, open file1.recognized_extension file2.recognized_extension should work like it does now in that test. you might find that PR that works on csv/tsv specifically to understand how it may change.
i think open file1.unrecognized_ext file2.unrecognized_ext should probably work like it does now except for any 8192 problems, which is group by file and produce a table so index 0 would be the first file and index 1 would be the second file.
I agree that working like Nushell should indeed be the goal, I just find it a bit inconsistent for your example 1 to return one stream, 2 to return one parsed table, 3 to return one parsed, joined table, and for 4 to return multiple strings / streams.
But I may not fully understand what you mean by:
4 works like 1 except that it gets passed through from ext.
As I understand, that's not what you're suggesting? You're suggesting that 1 concatenates the strings, but 4 doesn't? That seems like an additional difference on top of the from ext difference?
The pattern seems to be open returns one object, but that's broken for 4 only. I think I'd find it odd for open LICENSE LICENSE to return a list of two strings, but open Cargo.toml Cargo.toml to return a single table, hence my suggestion above. The [x y] | open syntax has nushell precedence with things like [x y] | str length in which str length is mapped over the piped-in list.
I'm also open to making things consistent in the opposite direction, where open always returns a list with one item for each file passed to it (identical to how [Cargo.toml, LICENSE] | each { open } works currently), but I do think that's a bit less helpful and at that point would almost favor dropping the ability of open to take multiple files in argument position entirely.
With that all said though, if others disagree and would prefer @fdncred 's outlined behaviour, then that's alright — anything is better than the current buggy behaviour!
TBH, I could live with it either way. I just wonder if we're arguing about something that people really don't care about. If 4 outputs 1 item or multiple grouped items really doesn't make much difference to me. It just seems like outputting multiple grouped items is more nushell-y. The bigger problem is the 8192 issue.
A:file-systemRelated to commands and core nushell behavior around the file systemA:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRA:streamingIssues related to streaming data (or collecting data when it should be streamed)category:bugSomething isn't working
Activity
sophiajt commentedon Aug 16, 2023
👍 that we should stream out. The BufReader may be fine if other parts of the system expect the whole stream to be understood as one value. It seems that we're treating each chunk from the stream separately.
TheLostLambda commentedon Apr 9, 2026
This is a wild bug that I think I've just run into as well — no
--rawneeded for these files (I'd imagine because Nushell doesn't natively read.jsonl):It's splitting the second file there, but if you load one file at a time:
amandalewis1231-lgtm commentedon Apr 9, 2026
TheLostLambda commentedon Apr 9, 2026
I'm being chased around GitHub by bots... So feel free to hide the above comment as spam... I nearly have a PR ready.
test(nu-command): add failing test for `open`
fdncred commentedon Apr 9, 2026
if you search the code base for 8192 you'll find that it's a buffer size and an output chunk size. i suspect this has something to do with the problem. sophia talks about needing to stream above.
TheLostLambda commentedon Apr 15, 2026
For everyone here, to get a final check on some chatting we were doing on the Discord, would people be okay with
open --raw Cargo.toml LICENSEreturning a single, concatenated string (like it returns concatenated tables), and if you want the current behaviour (returning a list of strings, but without the chunking, which I've identified the source of) you can pipe a list in? Like[Cargo.toml LICENSE] | open.By default then,
--rawor not,open x yacts just likecat x y, sticking things together, and if you want a list out, you can give it a list in:[x y] | open. I feel something like that would makeopenmore consistent and predictable!Let me know what you think!
fdncred commentedon Apr 15, 2026
This is what I said in Discord already. Working like
catis not the goal. Working like nushell is the goal. 4 works like 1 except that it gets passed throughfrom ext.Trying to help answer your question here so you can make some progress.
open -raw file1 file2 file3should produce a raw byte stream. i think this is similar to catopen file.recognized_extensionshould work the way it does today except not be hampered by 8192 bytes truncating things. streaming would be great.open file1.recognized_extension file2.recognized_extensionshould work like it does now in that test. you might find that PR that works on csv/tsv specifically to understand how it may change.open file1.unrecognized_ext file2.unrecognized_extshould probably work like it does now except for any 8192 problems, which is group by file and produce a table so index 0 would be the first file and index 1 would be the second file.TheLostLambda commentedon Apr 15, 2026
I agree that working like Nushell should indeed be the goal, I just find it a bit inconsistent for your example 1 to return one stream, 2 to return one parsed table, 3 to return one parsed, joined table, and for 4 to return multiple strings / streams.
But I may not fully understand what you mean by:
As I understand, that's not what you're suggesting? You're suggesting that 1 concatenates the strings, but 4 doesn't? That seems like an additional difference on top of the
from extdifference?The pattern seems to be
openreturns one object, but that's broken for 4 only. I think I'd find it odd foropen LICENSE LICENSEto return a list of two strings, butopen Cargo.toml Cargo.tomlto return a single table, hence my suggestion above. The[x y] | opensyntax has nushell precedence with things like[x y] | str lengthin whichstr lengthis mapped over the piped-in list.I'm also open to making things consistent in the opposite direction, where
openalways returns a list with one item for each file passed to it (identical to how[Cargo.toml, LICENSE] | each { open }works currently), but I do think that's a bit less helpful and at that point would almost favor dropping the ability ofopento take multiple files in argument position entirely.With that all said though, if others disagree and would prefer @fdncred 's outlined behaviour, then that's alright — anything is better than the current buggy behaviour!
fdncred commentedon Apr 15, 2026
TBH, I could live with it either way. I just wonder if we're arguing about something that people really don't care about. If 4 outputs 1 item or multiple grouped items really doesn't make much difference to me. It just seems like outputting multiple grouped items is more nushell-y. The bigger problem is the 8192 issue.
TheLostLambda commentedon Apr 15, 2026
@fdncred I think that's a fair point — I'll start on the 8192 issue and see if the code makes one path significantly easier or harder than the other!
I've got some technical implementation questions, but I'll ask those on Discord!
kronberger-droid commentedon Nov 14, 2026
Still reproduces on 0.117 with files of 25159 and 1069 bytes:
fix(open): chain the byte streams of several files like cat (nushell#…