nushell / nushell/nushell

FooterMode::RowCount and FooterMode::Auto should use the number of *rendered* rows

Open
#10,108 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:configuration category:enhancement
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Context

config.footer_mode can be set to a number N, in which case columns in tables will have footers rendered only if the table contains N or more records. This maps to the variant FooterMode::RowCount in Rust. For example:

image

footer_mode can also be set to "auto", which corresponds to FooterMode::Auto. In theory this should add a footer when the number of records exceeds the terminal height. However, it looks like this is not currently implemented and "auto" does nothing.

Problem

This approach breaks down when individual records span multiple terminal rows. For example, the output of scope commands | first 4 is taller than my entire monitor!

I do not want footers for a table that is only 4 rows tall when rendered, but if a table is too tall to fit in my terminal all at once I definitely do want footers.

Solution

Both RowCount and Auto should use the height of the table as rendered when determining whether to display a footer. For example:

  1. RowCount(10): If a table only contains 1 record but is rendered as 10+ rows tall because it contains multiline text, it will be rendered with a footer
  2. Auto: If a table is taller than the current terminal height when rendered, it will be rendered with a footer no matter how many records it has

This will probably require some changes to our table rendering code to pull off.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the config.footer_mode handling and the FooterMode::RowCount and FooterMode::Auto variants, then trace the table rendering code. Use examples such as scope commands | first 4 to compare record counts with rendered height; done means both modes decide whether to show footers from the rendered table height, including multiline records and terminal height for Auto.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.