Subject: Re: stty: TIOCGETD: Operation not supported
To: Mark Willey <mwilley@hillres142.cc.purdue.edu>
From: Brian de Alwis <bdealwis@Newbridge.COM>
List: netbsd-help
Date: 04/18/1995 08:50:33
> I get that error as well:
> stty: TIOCGETD: Operation not supported
> 
> It's only when my TERM is set to xterm cuz' in my .kshrc I have this:
> 
> if [ X$TERM = 'Xxterm' ]; then
>   stty erase 
> fi
> 
> My guess is that if it's not an interactive shell (no TTY attached) then
> stty does not have any meaning.  (A guess, with as many technical words as
> I know thrown in. :)  Look about in your .files and see if this is the case
> for you.

You can check for an interactive shell by testing the prompt. Something
like this will work:

if [ -n "$PS1" ]; then
    # interactive shell
    if [ "$TERM" = xterm ]; then
	stty erase ^h
    fi
fi
PS1="fancy prompt"

Make sure you put this before you set PS1 yourself.

-- 
Brian de Alwis - CS student at U of Waterloo, Co-op at Newbridge Networks Corp
-- bdealwis@Newbridge.COM, bsdealwis@UWaterloo.CA, bdealwis@sunsite.unc.edu --
==== Dore' is a free 3D graphical API. | NetBSD: Try it! You'll like it! =====