Skip to content

Commit

Permalink
fix(zsh): workaround for initial termwidth on zlogin
Browse files Browse the repository at this point in the history
When opening wezterm & termux for the first time, termwidth (tput cols)
always resulting 80 columns. That would overflow the bubble chat when
zsh login on my mobile screen with termux. Hence `$COLUMNS` env variable
is correctly detecting the actual screen / terminal width on zsh login.
  • Loading branch information
latipun7 committed Jul 14, 2023
1 parent 7e89d31 commit 5db5afb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions home/dot_zlogin
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

if hash fortune 2>/dev/null && hash chara 2>/dev/null; then
if hash lolcat 2>/dev/null; then
fortune | lolcat -f | chara say --random
fortune | lolcat -f | chara say --random --width=$(( ${COLUMNS:-55} - 6 ))
else
fortune | chara say --random
fortune | chara say --random --width=$(( ${COLUMNS:-55} - 6 ))
fi
fi

0 comments on commit 5db5afb

Please sign in to comment.