Skip to content

Commit

Permalink
Fix false-positive check for tty in flatpak
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MattSturgeon committed Jul 16, 2022
1 parent 4b611b7 commit 0a0b187
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conf.d/fishline-init.fish
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ end
source $FLINE_THEME_DIR/default_symbols.fish

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

0 comments on commit 0a0b187

Please sign in to comment.