A tput hunt brings me back to LQ
Posted 11-10-2006 at 11:01 PM by slakmagik
I haven't posted at all for over a year and a half (April 3, 2005-November 10, 2006). A search for more information about tput had an LQ link as searches sometimes do. I followed it here as I sometimes do (last time was back in August). Unlike those times, though, I replied to a few threads for some reason and decided to try out this new (to me) blog feature.
The link was to one of these new-fangledy blogs, but it didn't tell me anything I didn't already know. On the other hand, I didn't find anything much better. References in the bash prompt howto and maybe ABS and so on. And, of course, the man page for tput(1), as long as it's complemented with terminfo(5), pretty much covers it, I guess, and doesn't need a search engine.
Probably the best stuff, though, was by Okopnik (near the bottom) and Buckley but I basically agree with Okopnik - Buckley makes a good case and shows some useful 'in living color' examples, but Okopnik's right that terminfo capability names are gibberish (probably "[d]ue to a fixed buffer length in older termcap libraries (and a documented limit in terminfo"), and terminfo/caps are usually so broken that they're *less* portable than ANSI escapes, in a sense. Basically, using tput for simple colorizing probably works best for hardware terminals and can work for terminal emulators. Escape sequences probably work best for terminal emulators and can work for real terminals. Since vt100s seem to have no problem with escapes and most anything still in use should be vt100-capable, escapes may be safe enough for most purposes and, since they work consistently in linux, xterm, and mrxvt (which is all I ever use) -- and tput doesn't -- they're certainly good enough for me.
Um. So. I guess that counts as trying out the blog feature.
The link was to one of these new-fangledy blogs, but it didn't tell me anything I didn't already know. On the other hand, I didn't find anything much better. References in the bash prompt howto and maybe ABS and so on. And, of course, the man page for tput(1), as long as it's complemented with terminfo(5), pretty much covers it, I guess, and doesn't need a search engine.
Probably the best stuff, though, was by Okopnik (near the bottom) and Buckley but I basically agree with Okopnik - Buckley makes a good case and shows some useful 'in living color' examples, but Okopnik's right that terminfo capability names are gibberish (probably "[d]ue to a fixed buffer length in older termcap libraries (and a documented limit in terminfo"), and terminfo/caps are usually so broken that they're *less* portable than ANSI escapes, in a sense. Basically, using tput for simple colorizing probably works best for hardware terminals and can work for terminal emulators. Escape sequences probably work best for terminal emulators and can work for real terminals. Since vt100s seem to have no problem with escapes and most anything still in use should be vt100-capable, escapes may be safe enough for most purposes and, since they work consistently in linux, xterm, and mrxvt (which is all I ever use) -- and tput doesn't -- they're certainly good enough for me.
Um. So. I guess that counts as trying out the blog feature.









