summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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