[aklug] Re: terminal types and curses programming

From: Shane R. Spencer <shane@bogomip.com>
Date: Sat Jan 24 2009 - 12:39:00 AKST

Christopher Howard wrote:
> On Sat, 24 Jan 2009, Shane R. Spencer wrote:
>
>> As usual, I completely misread the issue at hand :)
>> Arthur is right, of course.
>>
>> Sounds like your reply on that thread should answer your question as
>> well. When in doubt grep the emacs source code for "Terminal type.*not
>> defined.". In src/term.c it shows a good example of error handling that
>> you may want to implement.
>>
>> Power to the people.
>>
>
> Thanks for the help everyone. Question: Do you guys know if there is an
> official list somewhere of the various terminal types and their
> descriptions/capabilities? I suppose I could just research every one in my
> terminfo directory individually, but it would be more convenient if
> someone had already done that. =] My awesome googling powers don't seem to
> be pulling anything up.
>
Understanding the terminal files themselves will be your path to
enlightenment. Sorry, watching I'm watching a horrible monk movie at the
moment.

Either way, I have a question for you. Is your program something a newb
would use or something geared more toward an experienced user? Does
failing to acquire a curses session leave anything like database
information or building of a file in an inconsistent or hard to recover
state?

It's great to have good error handling, but experienced users know that
when you're missing a TERM variable lots of stuff fails to work. And
the generic curses error message seems to work fine. It's a shame when
libraries like libncurses assume responsibility for exiting a program on
behalf of the main function otherwise you could easily do error handling
based on the result code of the function causing the issue. Grr, right?

Python has some wonderful error handling for most of it's modules and
extended modules and makes it very easy to attempt something that might
fail and recover gracefully if possible. I've found that when I start a
new program I want it to be something anybody in the world can use, but
then I remember that I'm creating something not just any user in the
world would even use. I usually realize this after I've just spent days
creating fault tolerant code that has pretty error messages. Maybe this
isn't the case for you, but I find that error handling often distracts
me from getting the functionality working.

Shane, Out.

-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl7inYACgkQXK/vGhypreIS0gCggAxTEW3p5J6hLkIP4YLF7DkB
rkcAn126kNdQ7YtHzY1ZF3pGrXUU5kil
=tF5C
-----END PGP SIGNATURE-----

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Jan 24 12:39:20 2009

This archive was generated by hypermail 2.1.8 : Sat Jan 24 2009 - 12:39:20 AKST