From c3449b5d6f6cd073f123f69d25605b62f9c34861 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 28 Oct 2015 21:16:38 -0400 Subject: term_lines(), term_columns(): New functions --- 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 -- cgit v0.9.1