diff --git a/nushell/config.nu b/nushell/config.nu index f06d4c9..897b5af 100644 --- a/nushell/config.nu +++ b/nushell/config.nu @@ -91,17 +91,29 @@ def _ls_format_mode [mode: string] { } def l [dir?: string] { - _ls (if $dir == null { "" } else { $dir }) + let output = _ls (if $dir == null { "" } else { $dir }) | sort-by type name -i - | grid -c -s " " - | cat + + if ($output | length) == 0 { + "" | cat + } else { + $output + | grid -c -s " " + | cat + } } def ls [dir?: string] { - _ls (if $dir == null { "" } else { $dir }) + let output = _ls (if $dir == null { "" } else { $dir }) | sort-by type name -i - | grid -c -s " " - | cat + + if ($output | length) == 0 { + "" | cat + } else { + $output + | grid -c -s " " + | cat + } } def la [dir?: string] {