From: Fred T. Hamster Date: Fri, 6 Dec 2024 20:25:51 +0000 (-0500) Subject: fixed terminal titler X-Git-Tag: 2.140.189^2~93 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=5d0b1af8b2992422bf058eb7e03f36136e0a92b8;p=feisty_meow.git fixed terminal titler it was hosing up non-interactive bash sessions due to trying to echo out in command line friendly way. bahhh, bad idea. fix now does not interfere in non-interactive sessions by checking special bash magic variables. we needed to add that, even beyond all the original checks on terminal type and prompts, because those were all coming in indicating that it was an interactive shell when it was not. but the magic check for that 'i' being present in the "$-" variable (yes, that's a dollar and a dash) did the trick. --- diff --git a/scripts/customize/fred/fred_variables.sh b/scripts/customize/fred/fred_variables.sh index 8ae11a0a..7627d643 100644 --- a/scripts/customize/fred/fred_variables.sh +++ b/scripts/customize/fred/fred_variables.sh @@ -46,9 +46,32 @@ if [ -z "$USER_CUSTOMIZATIONS_LOADED" ]; then # a dark background. export LS_COLORS='no=00:fi=00:di=01;37:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;35:*.rpm=00;33:*.deb=00;33:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;35:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;35:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' + ############## + # options for the lame mp3 encoder. export LAMEOPT="--alt-preset extreme" + ############## + + # our local domain and hosts of interest. + export GRUNTOSE_DOMAIN="gruntose.blurgh" + export GRUNTOSE_HOSTLIST=" + banshee +clambook + clemens + curie + greendragon + megasloth + morpheus + mrowrt + obsidian + surya +traveller + wildmutt +" + + ############## + # customization sentinel can be set now. export USER_CUSTOMIZATIONS_LOADED=true fi diff --git a/scripts/tty/terminal_titler.sh b/scripts/tty/terminal_titler.sh index a4e6a3fc..ce736d42 100644 --- a/scripts/tty/terminal_titler.sh +++ b/scripts/tty/terminal_titler.sh @@ -19,14 +19,22 @@ function apply_title_to_terminal() title="$(hostname)" fi - if [ "${TERM}" != "dumb" -a -z "$PBS_ENVIRONMENT" -a \ - ! -z "$PS1" -a "${TERM}" != "linux" ]; then - echo -n -e "\033]0;${title}\007" - else - # not running interactively, so just echo the title. - sep - echo "${title}" - sep + # first check if we're in an interactive shell, according to bash voodoo. + if [[ $- == *i* ]]; then + if [ "${TERM}" != "dumb" \ + -a -z "$PBS_ENVIRONMENT" \ + -a ! -z "$PS1" \ + -a "${TERM}" != "linux" \ + ]; then + echo -n -e "\033]0;${title}\007" +### else +### # not running interactively, so just echo the title. +#hmmm: oh hell no! what were you thinking? so non-interactive scripts get all sorts of terminal label goo injected into them? +# what a freaking nightmare. of course this is not okay to do!!! +### sep +### echo "${title}" +### sep + fi fi }