Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2000 14:31:19 +0100
From:      rene@xs4all.nl
To:        questions@freebsd.org
Subject:   echo and ANSI sequences?
Message-ID:  <2605.000218@xs4all.nl>

next in thread | raw e-mail | index | archive | help
Hello questions,

  I'm trying to teach my SSH window colors. I'm currently trying to
  get ANSI's 'reverse video' function to work.

  The deal is that I have an export PS1 that includes ANSI sequences
  that get rendered just fine. However, I'd like to 'simply' send an
  ANSI invert-video when I wanna switch (because the sun's just moved
  in the perfect glare-position ;).

  Echo, however, doesn't wanna play. I suspect the parsing of \e
  doesnt become a 1-byte ESC-character :((

  Any idea how I can best send this ANSI-sequence to my console?

9# cat /usr/bin/scripts/stc
if [ $TERM != xterm ]; then
        echo "You're not running this from inside an x-term. Aborting."
else
        case $1 in
          (b | black | B | BLACK)
                echo \e[0m\]
                ;;
          (w | white | W | WHITE)
                echo \e[7m\]
                ;;
        esac
fi


[root@messenger:/ date/time: Fri Feb 18/14:24:12]

10# stc w
e[7m]
[root@messenger:/ date/time: Fri Feb 18/14:24:19]

11#
  

  

Greetings, 
 rene <mailto:rene@xs4all.nl>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2605.000218>