Skip to content

list<string> values are not shown if a string is too wide #7591

Closed

Description

@rgwood

Describe the bug

If a list<string> contains a string that is too long, the string is replaced with ... instead of being truncated for display purposes

〉term size
╭─────────┬─────╮
│ columns │ 103 │
│ rows    │ 54  │
╰─────────┴─────╯
〉["foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobar"]
╭───┬─────╮
│ 0 │ ... │
╰───┴─────╯
〉["foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz fooba"]
╭───┬─────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 0 │ foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz foobarbaz fooba │
╰───┴─────────────────────────────────────────────────────────────────────────────────────────────────╯

How to reproduce

  1. Figure out your terminal width with term size
  2. Display a list with a string that is around the same width as your terminal

Expected behavior

I expected at least part of each string to be shown somehow, perhaps truncated if necessary. And table -e should definitely expand each field, but it does not.

Screenshots

I appreciate that it's not always obvious when to hide information and when to show it, but let's use horizontal space better than this:

image

Configuration

key value
version 0.73.1
branch main
commit_hash a43e66e
build_os linux-x86_64
build_target aarch64-unknown-linux-musl
rust_version rustc 1.65.0 (897e37553 2022-11-02)
cargo_version cargo 1.65.0 (4bc8f24d3 2022-10-20)
pkg_version 0.73.1
build_time 2022-12-24 00:07:25 +00:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. added
    A:table-renderer
    on Dec 24, 2022
  2. fdncred commented on Dec 24, 2022

    @fdncred
    Contributor
  3. fdncred commented on Dec 24, 2022

    @fdncred
    Contributor

    I wonder if it has something to do with the table settings. I get this
    Screenshot 2022-12-23 at 9 48 25 PM
    I'm not sure what the ... is for because the entire list is shown.

    This is my table settings.

      table: {
        mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
        index_mode: always #  "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
        trim: {     # A strategy of managing table view in case of limited space.
          methodology: wrapping # truncating or wrapping
          wrapping_try_keep_words: true
          # A suffix which will be used with 'truncating' methodology
          truncating_suffix: "…" # "⋯" "︙"
        }
      }
    
  4. rgwood commented on Dec 24, 2022

    @rgwood
    ContributorAuthor

    I'm using the default table settings:

    table: {
    mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
    index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
    trim: {
    methodology: wrapping # wrapping or truncating
    wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
    truncating_suffix: "..." # A suffix used by the 'truncating' methodology
    }
    }

    Nearly the same as yours (your truncating_suffix is a little different but I don't think that's the problem).

  5. fdncred commented on Dec 24, 2022

    @fdncred
    Contributor

    I can also do the odd truncating thing with table -e and table adds the extra ... column.
    Screenshot 2022-12-24 at 6 55 54 AM
    Screenshot 2022-12-24 at 7 04 51 AM

  6. added a commit that references this issue on Dec 25, 2022
    b499e7c
  7. added this to the v0.74 milestone on Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:table-renderer

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions