aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-04-07 12:38:45 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-04-07 12:38:45 +1200
commitee8f9287bf3416c06ee8b5179a672b400058d236 (patch)
treef3cbd71a92b36fe02933bdad679cd7099c6ca6ad /sh
parentMerge branch 'master' into port/bsd/freebsd (diff)
parentInstall shell types conditionally on $SHELL (diff)
downloaddotfiles-ee8f9287bf3416c06ee8b5179a672b400058d236.tar.gz
dotfiles-ee8f9287bf3416c06ee8b5179a672b400058d236.zip
Merge branch 'master' into port/bsd/freebsd
Diffstat (limited to 'sh')
-rw-r--r--sh/shrc.d/ls.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index 0fc6923a..05e7a06c 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -14,8 +14,10 @@ ls() {
# -F to show trailing indicators of the filetype
# -q to replace control chars with '?'
- # -x to format entries across, not down
- set -- -Fqx "$@"
+ set -- -Fq "$@"
+
+ # If output is to a terminal, add -x to format entries across, not down
+ [ -t 1 ] && set -- -x "$@"
# Add --block-size=K to always show the filesize in kibibytes
[ -e "$HOME"/.cache/ls/block-size ] &&