Change header_on_separator default to true

This commit is contained in:
Reilly Wood 2024-06-15 15:45:47 -07:00
parent 3a6d8aac0b
commit a90b1169a4
4 changed files with 18 additions and 24 deletions

View File

@ -96,22 +96,18 @@ Commands are separated by the pipe symbol (`|`) to denote a pipeline flowing lef
```shell ```shell
> ls | where type == "dir" | table > ls | where type == "dir" | table
╭────┬──────────┬──────┬─────────┬───────────────╮ ╭─#─┬──name───┬type─┬──size───┬───modified───╮
│ # │ name │ type │ size │ modified │ │ 0 │ assets │ dir │ 4.0 KiB │ 3 months ago │
├────┼──────────┼──────┼─────────┼───────────────┤ │ 1 │ benches │ dir │ 4.0 KiB │ 3 weeks ago │
│ 0 │ .cargo │ dir │ 0 B │ 9 minutes ago │ │ 2 │ crates │ dir │ 4.0 KiB │ 3 weeks ago │
│ 1 │ assets │ dir │ 0 B │ 2 weeks ago │ │ 3 │ devdocs │ dir │ 4.0 KiB │ 3 weeks ago │
│ 2 │ crates │ dir │ 4.0 KiB │ 2 weeks ago │ │ 4 │ docker │ dir │ 4.0 KiB │ 3 months ago │
│ 3 │ docker │ dir │ 0 B │ 2 weeks ago │ │ 5 │ scripts │ dir │ 4.0 KiB │ 3 weeks ago │
│ 4 │ docs │ dir │ 0 B │ 2 weeks ago │ │ 6 │ src │ dir │ 4.0 KiB │ 2 days ago │
│ 5 │ images │ dir │ 0 B │ 2 weeks ago │ │ 7 │ target │ dir │ 4.0 KiB │ 2 weeks ago │
│ 6 │ pkg_mgrs │ dir │ 0 B │ 2 weeks ago │ │ 8 │ tests │ dir │ 4.0 KiB │ 3 weeks ago │
│ 7 │ samples │ dir │ 0 B │ 2 weeks ago │ │ 9 │ wix │ dir │ 4.0 KiB │ a month ago │
│ 8 │ src │ dir │ 4.0 KiB │ 2 weeks ago │ ╰───┴─────────┴─────┴─────────┴──────────────╯
│ 9 │ target │ dir │ 0 B │ a day ago │
│ 10 │ tests │ dir │ 4.0 KiB │ 2 weeks ago │
│ 11 │ wix │ dir │ 0 B │ 2 weeks ago │
╰────┴──────────┴──────┴─────────┴───────────────╯
``` ```
Because most of the time you'll want to see the output of a pipeline, `table` is assumed. Because most of the time you'll want to see the output of a pipeline, `table` is assumed.
@ -126,9 +122,7 @@ For example, we could use the built-in `ps` command to get a list of the running
```shell ```shell
> ps | where cpu > 0 > ps | where cpu > 0
╭───┬───────┬───────────┬───────┬───────────┬───────────╮ ╭─#─┬──pid──┬───name────┬──cpu──┬────mem────┬──virtual──╮
│ # │ pid │ name │ cpu │ mem │ virtual │
├───┼───────┼───────────┼───────┼───────────┼───────────┤
│ 0 │ 2240 │ Slack.exe │ 16.40 │ 178.3 MiB │ 232.6 MiB │ │ 0 │ 2240 │ Slack.exe │ 16.40 │ 178.3 MiB │ 232.6 MiB │
│ 1 │ 16948 │ Slack.exe │ 16.32 │ 205.0 MiB │ 197.9 MiB │ │ 1 │ 16948 │ Slack.exe │ 16.32 │ 205.0 MiB │ 197.9 MiB │
│ 2 │ 17700 │ nu.exe │ 3.77 │ 26.1 MiB │ 8.8 MiB │ │ 2 │ 17700 │ nu.exe │ 3.77 │ 26.1 MiB │ 8.8 MiB │

View File

@ -52,7 +52,7 @@ pub struct Config {
pub external_completer: Option<Closure>, pub external_completer: Option<Closure>,
pub filesize_metric: bool, pub filesize_metric: bool,
pub table_mode: TableMode, pub table_mode: TableMode,
pub table_move_header: bool, pub table_header_on_border: bool,
pub table_show_empty: bool, pub table_show_empty: bool,
pub table_indent: TableIndent, pub table_indent: TableIndent,
pub table_abbreviation_threshold: Option<usize>, pub table_abbreviation_threshold: Option<usize>,
@ -125,7 +125,7 @@ impl Default for Config {
table_index_mode: TableIndexMode::Always, table_index_mode: TableIndexMode::Always,
table_show_empty: true, table_show_empty: true,
trim_strategy: TrimStrategy::default(), trim_strategy: TrimStrategy::default(),
table_move_header: false, table_header_on_border: true,
table_indent: TableIndent { left: 1, right: 1 }, table_indent: TableIndent { left: 1, right: 1 },
table_abbreviation_threshold: None, table_abbreviation_threshold: None,
@ -453,7 +453,7 @@ impl Value {
&mut errors); &mut errors);
} }
"header_on_separator" => { "header_on_separator" => {
process_bool_config(value, &mut errors, &mut config.table_move_header); process_bool_config(value, &mut errors, &mut config.table_header_on_border);
} }
"padding" => match value { "padding" => match value {
Value::Int { val, .. } => { Value::Int { val, .. } => {

View File

@ -24,7 +24,7 @@ pub fn create_nu_table_config(
with_header: out.with_header, with_header: out.with_header,
split_color: Some(lookup_separator_color(comp)), split_color: Some(lookup_separator_color(comp)),
trim: config.trim_strategy.clone(), trim: config.trim_strategy.clone(),
header_on_border: config.table_move_header, header_on_border: config.table_header_on_border,
expand, expand,
} }
} }

View File

@ -166,7 +166,7 @@ $env.config = {
wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
truncating_suffix: "..." # A suffix used by the 'truncating' methodology truncating_suffix: "..." # A suffix used by the 'truncating' methodology
} }
header_on_separator: false # show header text on separator/border line header_on_separator: true # show column headers on the top border of the table (more compact than in a separate header section)
# abbreviated_row_count: 10 # limit data rows from top and bottom after reaching a set point # abbreviated_row_count: 10 # limit data rows from top and bottom after reaching a set point
} }