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
true
true
true
| columns | rows |
| ------- | ---- |
| 0 | 0 |
Couldn't fit table into 0 columns!
Error:
× Main thread panicked.
├─▶ at crates/nu-command/src/viewers/table.rs:1104:10
╰─▶ Could not create empty table placeholder
help: set the `RUST_BACKTRACE=1` environment variable to display a
backtrace.
Tweak the nu script in main.go, tests shows following outcome:
[]: Panic
{}: Panic
[0]: Warning Couldn't fit table into 0 columns!
{a: b}: Warning Couldn't fit table into 0 columns!
Expected behavior
I expect nu to not panic in this situation. Would be better if nu can fallback zero-width pty to non-interactive environment and print tables info instead of showing a warning.
CircleCI is actually creating a zero-width pty for running commands. Not sure about other CI systems.
Configuration
key
value
version
0.102.0
major
0
minor
102
patch
0
branch
commit_hash
build_os
macos-aarch64
build_target
aarch64-apple-darwin
rust_version
rustc 1.84.1 (e71f9a9a9 2025-01-27) (Homebrew)
cargo_version
cargo 1.84.1
build_time
2025-02-04 15:49:35 +00:00
build_rust_channel
release
allocator
mimalloc
features
default, sqlite, trash
installed_plugins
The text was updated successfully, but these errors were encountered:
if there are no rows and no columns there is no place to render anything. having a terminal width is important to table structures so that it knows how to draw columns and wrap data. i'm not sure how this could work otherwise.
I really have no idea how output can work with 0 columns and 0 rows. I mean, I believe what you're saying. I'm just not sure how that works because the table command has to know how wide the table is to draw it. I'm sure it has defaults which I thought were 80x24 but could be wrong.
Describe the bug
On a zero column pty, nushell would panic when running
print ({})
orprint ([])
How to reproduce
I'm not really familiar with how to setup pty so just grabbed a go library to do this for me. Might have easier way to replicate this bug.
go run main.go
Output for the run is:
Tweak the nu script in
main.go
, tests shows following outcome:[]
: Panic{}
: Panic[0]
: WarningCouldn't fit table into 0 columns!
{a: b}
: WarningCouldn't fit table into 0 columns!
Expected behavior
I expect nu to not panic in this situation. Would be better if nu can fallback zero-width pty to non-interactive environment and print tables info instead of showing a warning.
CircleCI is actually creating a zero-width pty for running commands. Not sure about other CI systems.
Configuration
The text was updated successfully, but these errors were encountered: