aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay17
1 files changed, 12 insertions, 5 deletions
diff --git a/ponysay b/ponysay
index 4b5e912..9b5b2af 100755
--- a/ponysay
+++ b/ponysay
@@ -63,15 +63,22 @@ say() {
function wtrunc
{
- ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
- ${HOME}/.local/bin/ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
- ./ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
- cat
+ if [ "$PONYSAY_FULL_WIDTH" = 'no' ] || [ "$PONYSAY_FULL_WIDTH" = 'n' ] || [ "$PONYSAY_FULL_WIDTH" = '0' ]; then
+ cat
+ else
+ ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
+ ${HOME}/.local/bin/ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
+ ./ponysaytruncater `tput cols || echo 0` 2>/dev/null ||
+ cat
+ fi
}
function htrunc
{
- head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - 2 ))
+ if [ "$PONYSAY_SHELL_LINES" = "" ]; then
+ PONYSAY_SHELL_LINES=2
+ fi
+ head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - $PONYSAY_SHELL_LINES ))
}
if [ "$TERM" = "linux" ]; then