[GH-ISSUE #525] number-of-lines option in config file is ignored #229

Closed
opened 2026-06-08 11:26:15 +03:00 by zhus · 4 comments
Owner

Originally created by @wiraki on GitHub (Aug 27, 2025).
Original GitHub issue: https://github.com/bootandy/dust/issues/525

Before I start, thanks for creating dust, I really like it!

Description

The number-of-lines configuration option is not recognized when set in the config file (~/.config/dust/config.toml or ~/.dust.toml). The option works correctly when passed as a command-line argument but is completely ignored when specified in
the configuration file.

I guess this is because:

  1. Missing field in Config struct: The Config struct in src/config.rs doesn't have a number_of_lines field
  2. No getter method: There's no get_number_of_lines() method to merge config and CLI values
  3. Direct CLI access: In src/main.rs, the code only checks options.number_of_lines directly, bypassing the config entirely

Additionally, in my humble opinion, I find it strange to make the default limit the number of lines based on terminal height. If someone was to use the tool before carefully reading the help, they might miss the fact that the output is automatically truncated by default, and that is not a common behavior of CLI tools, so it is unexpected. While I like the idea to be able to limit the output based on the terminal height, I think that it would be better as a toggle to turn on.

Sorry, I do not have much Rust experience nor the tech stack to make the contribution myself.

Steps to Reproduce

  1. Create a config file at ~/.config/dust/config.toml with:
    number-of-lines=999
  2. Run dust without any command-line arguments in a directory with many files and subdirectories.
  3. Observe that the output is still limited by terminal height.

Expected Behavior

The number-of-lines setting from the config file should be respected when no command-line argument is provided, similar to how other options like depth, reverse, and output-format work.

Actual Behavior

The config file setting is ignored, and dust always uses the default behavior (terminal height - 10) unless explicitly overridden via command-line with -l or --number-of-lines.

Environment

  • dust version: 1.2.3
  • OS: Linux - Pop!_OS
Originally created by @wiraki on GitHub (Aug 27, 2025). Original GitHub issue: https://github.com/bootandy/dust/issues/525 Before I start, thanks for creating `dust`, I really like it! ### Description The `number-of-lines` configuration option is not recognized when set in the config file (`~/.config/dust/config.toml` or `~/.dust.toml`). The option works correctly when passed as a command-line argument but is completely ignored when specified in the configuration file. I guess this is because: 1. Missing field in Config struct: The Config struct in `src/config.rs` doesn't have a `number_of_lines` field 2. No getter method: There's no `get_number_of_lines()` method to merge config and CLI values 3. Direct CLI access: In `src/main.rs`, the code only checks `options.number_of_lines` directly, bypassing the config entirely Additionally, in my humble opinion, I find it strange to make the default limit the number of lines based on terminal height. If someone was to use the tool before carefully reading the help, they might miss the fact that the output is automatically truncated by default, and that is not a common behavior of CLI tools, so it is unexpected. While I like the idea to be able to limit the output based on the terminal height, I think that it would be better as a toggle to turn on. Sorry, I do not have much Rust experience nor the tech stack to make the contribution myself. ### Steps to Reproduce 1. Create a config file at `~/.config/dust/config.toml` with: `number-of-lines=999` 2. Run `dust` without any command-line arguments in a directory with many files and subdirectories. 3. Observe that the output is still limited by terminal height. ### Expected Behavior The `number-of-lines` setting from the config file should be respected when no command-line argument is provided, similar to how other options like `depth`, `reverse`, and `output-format` work. ### Actual Behavior The config file setting is ignored, and `dust` always uses the default behavior (terminal height - 10) unless explicitly overridden via command-line with `-l` or `--number-of-lines`. ### Environment - dust version: 1.2.3 - OS: Linux - Pop!_OS
zhus closed this issue 2026-06-08 11:26:15 +03:00
Author
Owner

@sam-kleiner commented on GitHub (Sep 8, 2025):

I think no-percent-bars may have the same issue

I tried:

bars=false
no_bars=true
percent_bars=false
no_percent_bars=true

bars=0
no_bars=1
percent_bars=0
no_percent_bars=1
<!-- gh-comment-id:3264521526 --> @sam-kleiner commented on GitHub (Sep 8, 2025): I think no-percent-bars may have the same issue I tried: ``` bars=false no_bars=true percent_bars=false no_percent_bars=true bars=0 no_bars=1 percent_bars=0 no_percent_bars=1 ```
Author
Owner

@vasac commented on GitHub (Sep 26, 2025):

@sam-kleiner config settings use kebab-case - no-bars=true should work.

<!-- gh-comment-id:3336181828 --> @vasac commented on GitHub (Sep 26, 2025): @sam-kleiner config settings use kebab-case - `no-bars=true` should work.
Author
Owner

@bootandy commented on GitHub (Oct 6, 2025):

Thanks @vasac yes

config settings use kebab-case - no-bars=true should work.

you can copy the config file from config/config.toml if you need inspiration

<!-- gh-comment-id:3373445211 --> @bootandy commented on GitHub (Oct 6, 2025): Thanks @vasac yes > config settings use kebab-case - no-bars=true should work. you can copy the config file from `config/config.toml` if you need inspiration
Author
Owner

@bootandy commented on GitHub (Oct 6, 2025):

The number-of-lines configuration option is not recognized when set in the config file (~/.config/dust/config.toml or ~/.dust.tom

Yes, it never occurred to me that someone would actually want to do this. But I'm happy to include the PR if you'd like.

<!-- gh-comment-id:3373463726 --> @bootandy commented on GitHub (Oct 6, 2025): >The number-of-lines configuration option is not recognized when set in the config file (~/.config/dust/config.toml or ~/.dust.tom Yes, it never occurred to me that someone would actually want to do this. But I'm happy to include the PR if you'd like.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#229