Re: Bash Issues

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Mon, 13 Dec 1999 19:58:20 +0000 (GMT)


On Mon, 13 Dec 1999, Jeff V. Merkey wrote:

[ silly backs quoting fixed - maybe you'd like to do that yourself
next time ]

> > > for Linux it's (n)curses, except Linux has the poorest look and feel of
> > > the three because the default for these shells don't let you use all
> > > ASCII charaters to make cool little boxes and such without a lot of work
> > > and research into how shells work.
> >
> > The shell isnt the one defining what you can use.
>
> Pardon my ignorance of unix lingo Alan, but what does?

*You* do.

You have a file descriptor to which you can write arbitrary bytes,
including escape sequences. You also have the TERM environment variable.

So you just need to look up the terminal's capabilities and behaviour in a
database of some sort (termcap/terminfo) and write the correct stuff to
the display.

The _shell_ doesn't even need to interpret TERM in most cases. It just
happens that that's necessary to be able to implement command history and
the other funky things.

This stuff is pretty uninteresting (to most :), so you can just be glad
that the ncurses people did such a fine job.

If you want sample code for drawing pretty boxes, look at the GNU Midnight
Commander, or maybe the newt library which Red Hat made for some of their
text mode stuff. (Be warned that the latter doesn't seem to deal very
well with terminals which don't do line drawing characters.)

Hell, just write your interface using newt and be done with it. It'll
look pretty under the Linux console and Xterm, and if you want more than
that, you can fix newt to work on my slightly dodgy Wyse terminal.

Matthew.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/