aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-05 09:17:43 +0200
committerMattias Andrée <maandree@operamail.com>2012-07-05 09:17:43 +0200
commit348c0084a892b6967249e26a40f529301f7172e4 (patch)
treeffe0d658c578481f48b8bdcd6c65a2e1cb6df2e4
parent4a39ef423041bee3faafc99ee60bf0dbb1229868 (diff)
downloadponysay-348c0084a892b6967249e26a40f529301f7172e4.tar.gz
ponysay-348c0084a892b6967249e26a40f529301f7172e4.tar.bz2
ponysay-348c0084a892b6967249e26a40f529301f7172e4.zip
environment variable PONYSAY_TRUNCATE_HEIGHT
-rw-r--r--manpage.13
-rwxr-xr-xponysay2
2 files changed, 4 insertions, 1 deletions
diff --git a/manpage.1 b/manpage.1
index 57c4222..ec35533 100644
--- a/manpage.1
+++ b/manpage.1
@@ -70,6 +70,9 @@ than the screen.
.B PONYSAY_FULL_WIDTH
You can export \fBPONYSAY_FULL_WIDTH\fP with the value \fIno\fP, \fIn\fP or \fI0\fP, if you
do not want the output to be truncated on the width to fit the terminal.
+.B PONYSAY_TRUNCATE_HEIGHT
+Export \fBPONYSAY_TRUNCATE_HEIGHT\fP with the value \fIyes\fP, \fIy\fP or \fI1\fP, if you
+want to truncate the output on the height even if you are not running \fIponysay\fP under TTY.
.SH BUG
Bugs can be reported in <\fBhttps://github.com/erkin/ponysay/issues\fP>.
.SH SEE ALSO
diff --git a/ponysay b/ponysay
index 9b5b2af..46c288e 100755
--- a/ponysay
+++ b/ponysay
@@ -81,7 +81,7 @@ say() {
head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - $PONYSAY_SHELL_LINES ))
}
- if [ "$TERM" = "linux" ]; then
+ if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then
if [ "$PONYSAY_BOTTOM" = 'yes' ] || [ "$PONYSAY_BOTTOM" = 'y' ] || [ "$PONYSAY_BOTTOM" = '1' ]; then
exec "$cmd" -f "$pony" "${wrap:+-W$wrap}" | wtrunc | tac | htrunc | tac
else