mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-26 06:07:59 +01:00
using stty and cut (coreutils) instead of tput (ncurses) for getting terminal width
This commit is contained in:
parent
348c0084a8
commit
2cc95ba021
1 changed files with 4 additions and 3 deletions
7
ponysay
7
ponysay
|
@ -66,9 +66,10 @@ say() {
|
||||||
if [ "$PONYSAY_FULL_WIDTH" = 'no' ] || [ "$PONYSAY_FULL_WIDTH" = 'n' ] || [ "$PONYSAY_FULL_WIDTH" = '0' ]; then
|
if [ "$PONYSAY_FULL_WIDTH" = 'no' ] || [ "$PONYSAY_FULL_WIDTH" = 'n' ] || [ "$PONYSAY_FULL_WIDTH" = '0' ]; then
|
||||||
cat
|
cat
|
||||||
else
|
else
|
||||||
ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
|
WIDTH=$((stty size <&2 || echo 0 0) | cut -d ' ' -f 2)
|
||||||
${HOME}/.local/bin/ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
|
ponysaytruncater $WIDTH 2>/dev/null ||
|
||||||
./ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
|
${HOME}/.local/bin/ponysaytruncater $WIDTH 2>/dev/null ||
|
||||||
|
./ponysaytruncater $WIDTH 2>/dev/null ||
|
||||||
cat
|
cat
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue