diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/Termcast.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index c4d0293..d2fff29 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -130,10 +130,14 @@ sub _build_establishment_message { return sprintf("hello %s %s\n", $self->user, $self->password); } +sub _termsize { + return try { GetTerminalSize() } catch { (undef, undef) }; +} + sub termsize_message { my $self = shift; - my ($cols, $lines) = try { GetTerminalSize() }; + my ($cols, $lines) = $self->_termsize; return '' unless $cols && $lines; |