terminfo

Is there a tool to clean the output of the script(1) tool?

script(1) is a tool for keeping a record of an interactive terminal session; by default it writes to the file transcript. My problem is that I use ksh93, which has readline features, and so the transcript is mucked up with all sorts of terminal escape sequences and it can be very difficult to reconstruct the command that was actually e...

How do I determine if a terminal is color-capable?

I would like to change a program to automatically detect whether a terminal is color-capable or not, so when I run said program from within a non-color capable terminal (say M-x shell in (X)Emacs), color is automatically turned off. I don't want to hardcode the program to detect TERM={emacs,dumb}. I am thinking that termcap/terminfo sh...

Why setupterm terminates the program?

This is sample program from "Beginning Linux Programming" book: #include <stdio.h> #include <term.h> #include <curses.h> #include <stdlib.h> int main() { setupterm("unlisted", fileno(stdout), (int *)0); printf("Done.\n"); exit(0); } Running it, I have this result: ./badterm 'unlisted': unknown terminal type. Accordi...

Printing double-size characters with Ncurses

Many terminal emulators (xterm, Konsole) support double-size characters. Ncurses does not support this and as far as I know, ncurses will not print escape characters (\033 will be unescaped and printed in clear text). Is it possible at all to print double-size characters in a ncurses application? ...