Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the starting index of table is wrongly starts with 1 #7338

Closed
WindSoilder opened this issue Dec 3, 2022 · 11 comments
Closed

the starting index of table is wrongly starts with 1 #7338

WindSoilder opened this issue Dec 3, 2022 · 11 comments
Milestone

Comments

@WindSoilder
Copy link
Collaborator

Describe the bug

@kurokirasama spotted this, when viewing a table, the first index is 1 rather than 0.

How to reproduce

❯ [{'a': 1}]
╭───┬───╮
│ # │ a │
├───┼───┤
│ 1 │ 1 │
╰───┴───╯

Expected behavior

The table should starts with index 0

Screenshots

No response

Configuration

key value
version 0.72.1
branch main
commit_hash 850ecf6
build_os macos-x86_64
build_target x86_64-apple-darwin
rust_version rustc 1.65.0 (897e37553 2022-11-02)
rust_channel stable-x86_64-apple-darwin
cargo_version cargo 1.65.0 (4bc8f24d3 2022-10-20)
pkg_version 0.72.1
build_time 2022-12-03 18:28:27 +08:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins gstat

Additional context

No response

@fdncred
Copy link
Collaborator

fdncred commented Dec 3, 2022

/cc @zhiburt

@zhiburt
Copy link
Contributor

zhiburt commented Dec 3, 2022

Hi there,

How do you @WindSoilder run it exactly?

image

PS: I don't want to believe it's platform specific :)

@kurokirasama
Copy link

I'm on Ubuntu in latest repo build

@fdncred
Copy link
Collaborator

fdncred commented Dec 3, 2022

Some on mac.
Screenshot 2022-12-03 at 10 10 13 AM

I wonder if it could be something with config.nu settings - I can't think of one that would cause this though. It's as if it were being passed through table -n 1

@DarkPark
Copy link

DarkPark commented Dec 3, 2022

Confirm the problem. A very unpleasant one.
Debian 11.
image

@WindSoilder
Copy link
Collaborator Author

Additionally, I've tried [{a: 1}] | table, and the result is fine

@zhiburt
Copy link
Contributor

zhiburt commented Dec 3, 2022

Hmmmmm

on linux on the same comit still OK for me.

Could you run cargo run -- -c '[{'a': 1}]'?

@kurokirasama
Copy link

kurokirasama commented Dec 3, 2022

but [{a: 1}] is a table and [{a: 1}] | table is a raw input (according to describe

zhiburt added a commit to zhiburt/nushell that referenced this issue Dec 3, 2022
Signed-off-by: Maxim Zhiburt <[email protected]>
@zhiburt
Copy link
Contributor

zhiburt commented Dec 3, 2022

Could you try this?

#7343

@WindSoilder
Copy link
Collaborator Author

@zhiburt Thanks, I've check the pr build, it works fine for me

@fdncred
Copy link
Collaborator

fdncred commented Dec 4, 2022

Could you try this?

That fixes it for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants