From b02c93705f21db3f13736d1bc41d2f0e01ccae2b Mon Sep 17 00:00:00 2001 From: Gabriel Moreau <gabriel.moreau@univ-grenoble-alpes.fr> Date: Sun, 15 Jan 2023 20:44:55 +0100 Subject: [PATCH] Use size with stty if tput is not present. Update Copyright and version. --- tssh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tssh b/tssh index ca8cd81..2abbce0 100644 --- a/tssh +++ b/tssh @@ -7,7 +7,7 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin export LANG=C -VERSION='0.4.12' +VERSION='0.4.13' function usage() { cat <<END_USAGE @@ -50,7 +50,9 @@ export ssh_cmd=ssh export split_number=16 if which tput > /dev/null then - export split_number=$(( ($(tput lines)/ 10) * ($(tput cols)/ 40) )) + export split_number=$(( ($(tput lines)/ 10) * ($(tput cols)/ 40) )) +else + export split_number=$(( ($(stty size | cut -f 1 -d ' ')/ 10) * ($(stty size | cut -f 2 -d ' ')/ 40) )) fi export dyn_domain='' @@ -538,7 +540,7 @@ This is not mandatory for general use. When it starts, C<tssh> uses C<tput> to find out the number of columns and rows in your terminal. By default, it takes 10 rows and 40 columns for each window. -If C<tput> is not installed, the default is to divide the screen into 16 subwindows... +If C<tput> is not installed, the C<stty> command is used with the C<size> option... =head1 SEE ALSO @@ -565,5 +567,5 @@ Written by Gabriel Moreau, Grenoble - France =head1 COPYRIGHT -Copyright (C) 2014-2022, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France +Copyright (C) 2014-2023, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France Licence : GNU GPL version 2 or later -- GitLab