From 95ecf17ded7da7ec4e9aeb3e29ecb5fb681810d2 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 25 May 2011 21:39:38 +0000 Subject: [PATCH] cleanup --- inxi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index fdb91f0..d219558 100755 --- a/inxi +++ b/inxi @@ -6318,7 +6318,7 @@ print_system_data() local host_name=$( hostname ) local current_kernel=$( uname -rm ) # | gawk '{print $1,$3,$(NF-1)}' ) local distro="$( get_distro_data )" - local tty_session=$( basename $(tty) | sed 's/[^0-9]*//g' ) + local tty_session=$( basename "$( tty 2>/dev/null )" | sed 's/[^0-9]*//g' ) # this handles the different, shorter, irc colors strings embedded in variable data if [[ $B_RUNNING_IN_SHELL != 'true' ]];then @@ -6336,7 +6336,10 @@ print_system_data() desktop_environment='N/A' fi else - desktop_environment="tty $tty_session" + if [[ -n $tty_session ]];then + tty_session=" $tty_session" + fi + desktop_environment="tty$tty_session" desktop_type='Console' fi de_distro_string="${C1}$desktop_type${C2} $desktop_environment ${C1}Distro${C2} $distro"