mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #2413 from deantvv/ls-show-control-if-tty
ls: set show-control-char if stdout is terminal
This commit is contained in:
commit
54ccfdfd9f
1 changed files with 3 additions and 2 deletions
|
@ -382,10 +382,11 @@ impl Config {
|
|||
#[allow(clippy::needless_bool)]
|
||||
let show_control = if options.is_present(options::HIDE_CONTROL_CHARS) {
|
||||
false
|
||||
} else if options.is_present(options::SHOW_CONTROL_CHARS) {
|
||||
} else if options.is_present(options::SHOW_CONTROL_CHARS) || atty::is(atty::Stream::Stdout)
|
||||
{
|
||||
true
|
||||
} else {
|
||||
false // TODO: only if output is a terminal and the program is `ls`
|
||||
false
|
||||
};
|
||||
|
||||
let quoting_style = if let Some(style) = options.value_of(options::QUOTING_STYLE) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue