(I'm answering my own question here, just for the
record... so don't waste your time on this if you're looking
for questions to answer...)

Okay, so since I've been tweaking my httpd.conf a lot
lately, I get to do things like this a lot: 

   su 
   /etc/rc.d/init.d/httpd restart

And since I live inside emacs, I do this inside an emacs
subshell, where I constantly get treated to displays like
this, littered with ansi control sequences: 

   Shutting down http: ^[[60G[  ^[[1;32mOK^[[0;39m  ]
   Starting httpd: ^[[60G[  ^[[1;32mOK^[[0;39m  ]

These are of course supposed to be putting pretty colors on
the screen to make it easier for me to read the word "OK" 
or "FAILED", but instead they do a good job of concealing
the result completely. 

I tried a few ways of fixing this obnoxious behavior, but
the following is what worked.

After some blundering around I noticed that there was an if
block in:

  /etc/rc.d/init.d/functions

that removed the ansi sequences for consoles of type
"serial".  I ran /sbin/consoletype in an emacs sub-shell, 
and discovered that it was type "pty".  

So as a quick fix, I just cloned the entire if block, and
changed the "serial" to "pty":

    if [ "`consoletype`" = "pty" ]; then
      BOOTUP=serial
      MOVE_TO_COL=
      SETCOLOR_SUCCESS=
      SETCOLOR_FAILURE=
      SETCOLOR_WARNING=
      SETCOLOR_NORMAL=
    fi


If someone wants to point out that I could've done an OR and
just made the test a litte more complex, I will not argue.
I haven't been Bourne shelling much of late and did not feel
like looking up the syntax.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to