Skip to content

Commit 0a0b187

Browse files
committed
Fix false-positive check for tty in flatpak
When there is absolutely no tty set at all (e.g. in a shell spawned by a flatpak), tty prints 'not a tty', which matches `tty | grep "tty"`. Luckily `tty` also returns `1`, so we can do a two-stage check instead. This fixes #38
1 parent 4b611b7 commit 0a0b187

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

conf.d/fishline-init.fish

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ end
1313
source $FLINE_THEME_DIR/default_symbols.fish
1414

1515
# Load default color theme depending on terminal capabilities
16-
if begin; [ (uname) != "Darwin" ]; and tty | grep tty > /dev/null; end
16+
if begin;
17+
[ (uname) != "Darwin" ]
18+
and set -l out (tty)
19+
and string match -eq "tty" $out;
20+
end
1721
# Emable a TTY safe default theme if a TTY is detected
1822
source $FLINE_THEME_DIR/tty_compatible.fish
1923
else if begin; not command -s tput > /dev/null; or [ (tput colors) -lt 256 ]; end

0 commit comments

Comments
 (0)