From 9970d429097d20556def07d9e9b6cf5997413d2b Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sun, 6 May 2012 23:45:21 +0200 Subject: [PATCH] make reader detect xterm/screen better --- tools/mesh/beacon-udp.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/mesh/beacon-udp.pl b/tools/mesh/beacon-udp.pl index 70415e4..c54e869 100755 --- a/tools/mesh/beacon-udp.pl +++ b/tools/mesh/beacon-udp.pl @@ -70,8 +70,12 @@ my $hispaddr = sockaddr_in($port, $hisiaddr); ###send(SOCKET, 0, 0, $hispaddr); -my $xterm=0; -my $screen=1; +my $xterm=$ENV{TERM}eq"xterm"?1:0; +my $screen=$ENV{TERM}eq"screen"?1:0; + +if (! -t 1){ + $xterm=$screen=0; +}; my $crcerr=0; my $errors=0;