summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-10-28 21:16:38 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-10-28 21:16:38 (EDT)
commitc3449b5d6f6cd073f123f69d25605b62f9c34861 (patch)
tree6e69838bfb89c8621a3b6382e77b90d0f450ef13
parent9ffcc872fc8866efe70fdb0a5c182c4dd3a2dac9 (diff)
downloadfirman.sh-c3449b5d6f6cd073f123f69d25605b62f9c34861.zip
firman.sh-c3449b5d6f6cd073f123f69d25605b62f9c34861.tar.gz
firman.sh-c3449b5d6f6cd073f123f69d25605b62f9c34861.tar.bz2
term_lines(), term_columns(): New functions
-rw-r--r--src/term.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/term.sh b/src/term.sh
index f6b8a00..0146ea1 100644
--- a/src/term.sh
+++ b/src/term.sh
@@ -17,14 +17,31 @@
term_tty=
term_byte=
+term_num_lines=
+term_num_columns=
term_init()
{
term_tty="$(tty)"
+ read -r term_num_lines term_num_columns <<-EOF
+ $(stty size)
+ EOF
return 0
}
+term_lines()
+{
+ printf '%d' ${term_num_lines}
+ return 0
+}
+
+term_columns()
+{
+ printf '%d' ${term_num_columns}
+ return 0
+}
+
term_echo()
{
stty echo