Skip to content

Add -RepeatHeader to Format-Table to enable repeating header for each screen full - #8481

Merged
Dongbo Wang (daxian-dbw) merged 7 commits into
PowerShell:masterfrom
SteveL-MSFT:format-table-header
Dec 20, 2018
Merged

Add -RepeatHeader to Format-Table to enable repeating header for each screen full#8481
Dongbo Wang (daxian-dbw) merged 7 commits into
PowerShell:masterfrom
SteveL-MSFT:format-table-header

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 18, 2018

Copy link
Copy Markdown
Member

PR Summary

When using a screen reader or just getting the output of a table with lots of rows, the header is no longer on the screen and the columns may no longer make sense without the context. This PR adds a -RepeatHeader switch to Format-Table to enable re-outputting the header after every screen full (minus 1 row). Expectation is that the user is piping the output to a pager (e.g. less) which uses the bottom row for pager information. I followed the AutoSize parameter as the way to get the parameter from the cmdlet into the deep formatting object where it's needed.

gifv

Fix #8455

PR Checklist

@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Dec 18, 2018

Copy link
Copy Markdown
Member Author

The remaining codefactor issues are not related to this PR or I'm adopting the current conventions in the source code for consistency but breaks CodeFactor rules.

@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the format-table-header branch 2 times, most recently from 1073566 to 38c5f8e Compare December 18, 2018 05:47
Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Outdated
Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Outdated
Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Outdated
Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Outdated
Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Outdated
Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Outdated
Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Outdated
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 110f78b into PowerShell:master Dec 20, 2018
@iSazonov Ilya (iSazonov) added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Jan 17, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the format-table-header branch June 6, 2020 02:29
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…each screen full (PowerShell#8481)

When using a screen reader or just getting the output of a table with lots of rows, the header is no longer on the screen and the columns may no longer make sense without the context.  This change adds a `-RepeatHeader` switch to `Format-Table` to enable re-outputting the header after every screen full (minus 1 row).  Expectation is that the user is piping the output to a pager (e.g. less) which uses the bottom row for pager information.  I followed the `AutoSize` parameter as the way to get the parameter from the cmdlet into the deep formatting object where it's needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable repeating table headers with Format-Table

4 participants