Repository navigation
fix table truncating vs wrapping - #18979
Merged
Merged
Conversation
Closed
2 tasks done
fdncred
added a commit
that referenced
this pull request
Sep 11, 2026
<!-- Thanks for contributing to Nushell! Before submitting, please read the contributing guide: https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md This template helps reviewers understand your changes and allows us to generate high-quality release notes. --> ## Description This PR tries to fix a bug where nested tables weren't wrapping properly. <!-- Explain what this PR does and why. This section is intentionally flexible: - Describe the problem - Explain your approach - Include technical details if relevant Good examples: - "In this PR, I fixed..." - "In this PR, I added support for..." - "This change improves X by..." Write as much or as little as needed for reviewers to understand your changes. --> ## User-facing changes (Release notes) Fixed `table --expand` wrapping nested tables as text, which broke their borders (for example `plugin list` after #18979). Long cells in nested tables still wrap or truncate **inside** the inner table according to `$env.config.table.trim`. The inner box stays a table. Scalar columns on the parent still wrap or truncate the same way as in #18979. <!-- This section is used (mostly as-is) for https://www.nushell.sh/blog/ Describe how Nushell behavior changes from a user's perspective. Do NOT describe internal Rust changes here. Write in a release note style, for example: - "Added support for..." - "Fixed an issue where..." - "Nushell now supports..." - "Improved performance of..." If your changes do NOT affect users (internal refactors, cleanup, etc.), just write: - "n/a" - "nan" - or similar This tells us the change should not appear in the changelog. Tips: - Focus on observable behavior - Include examples if helpful - Keep it concise You can: - Write a short paragraph (will appear as a bullet point), OR - Use headings (###) if your change needs more structure Avoid writing things like: - "In this PR, I refactored..." - "This updates internal code..." You may leave this blank until the PR is ready. --> ## Additional notes closes #19002 <!-- Optional. Examples: - fixes #123 - closes #456 - related #789 Anything else reviewers should know. Remove this section if not needed. -->
fdncred
pushed a commit
that referenced
this pull request
Sep 23, 2026
…19066) With `$env.config.table.header_on_separator = true`, the `markdown` and `restructured` themes drew the header inside the top border, which produces invalid markup: ``` |-#-|-a-|-b-| | 0 | 1 | 2 | ``` ``` =#= =a= =b= 0 1 2 === === === ``` These two themes exist to emit markup that other tools parse, so as suggested in #13161, `configure_table` now ignores `header_on_separator` for them. Every table goes through `configure_table` (general and `--expand`), so this covers both. Other themes are unchanged. After: ``` | # | a | b | |---|---|---| | 0 | 1 | 2 | ``` `wrap_and_truncate_differ_for_every_theme_with_header_on_separator` (from #18979) no longer lists `markdown` and `restructured`. With the header in its own row, wrapping and truncating give identical output for this data on every theme (e.g. `rounded` with `header_on_separator = false`), because overflowing columns are replaced with `...`. The two only differ in the header-on-border layout, which these themes no longer use. ## User-facing changes (Release notes) `table --theme markdown` and `table --theme restructured` (and the matching `$env.config.table.mode` values) now always produce valid Markdown / reStructuredText, even when `$env.config.table.header_on_separator` is enabled. ## Tests + Formatting - Added `table_markup_themes_ignore_header_on_separator`. It fails without this change (`|-#-|-a-|-b-|`) and passes with it. - `cargo test -p nu-command --test tests -- commands::table::`: 492 passed - `cargo fmt --all -- --check` - `cargo clippy -p nu-table -p nu-command --all-targets -- -D warnings -D clippy::unwrap_used` ## Additional notes Fixes #13161 Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
At some point in time table column truncating vs column wrapping was broken.
$env.config.table.trimis supposed to control how a visible column that is narrower than its content is fitted:truncating_suffixThat did not work in the cases people actually hit.
This PR tries to fix that problem.
User-facing changes (Release notes)
Table display now respects
$env.config.table.trimwrapping and truncating more consistentlyFixed
$env.config.table.trimso wrapping and truncating actually differ on default table display (table -eon terminals 100 columns or wider), including withheader_on_separator....; a squeezed cell getstruncating_suffix.size/s/i/z/eladder)....column is nottruncating_suffix. That suffix only appears when a visible cell is cut.Example:
wrapping
truncating
Additional notes
closes #18966