Skip to content

index column does not get collapsed to # when rendered with table command #14842

Closed
@NotTheDr01ds

Description

Describe the bug

The table command renders a table with a column named index in both the # and index column. It should only be displayed in the # column.

table -e works correctly.

How to reproduce

# Correct
[
 [ index     var ];
 [ abc         1 ]
 [ def         2 ]
 [ ghi         3 ]
]
# => ╭─────┬─────╮
# => │   # │ var │
# => ├─────┼─────┤
# => │ abc │   1 │
# => │ def │   2 │
# => │ ghi │   3 │
# => ╰─────┴─────╯

# Incorrect
[[ index     var ];
 [ abc         1 ]
 [ def         2 ]
 [ ghi         3 ]
] | table
# => ╭─────┬───────┬─────╮
# => │   # │ index │ var │
# => ├─────┼───────┼─────┤
# => │ abc │ abc   │   1 │
# => │ def │ def   │   2 │
# => │ ghi │ ghi   │   3 │
# => ╰─────┴───────┴─────╯

# Also correct
[
 [ index     var ];
 [ abc         1 ]
 [ def         2 ]
 [ ghi         3 ]
] | table -e
# => ╭─────┬─────╮
# => │   # │ var │
# => ├─────┼─────┤
# => │ abc │   1 │
# => │ def │   2 │
# => │ ghi │   3 │
# => ╰─────┴─────╯

Expected behavior

table to not render a column named index, but rather only render it as #

Configuration

key value
version 0.101.1
major 0
minor 101
patch 1
branch main
commit_hash 23dc1b6
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.82.0 (f6e511eec 2024-10-15)
rust_channel 1.82.0-aarch64-apple-darwin
cargo_version cargo 1.82.0 (8f40fc59f 2024-08-21)
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash
installed_plugins

Metadata

Assignees

No one assigned

    Labels

    needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions