When I login to a remote machine (Debian Wheezy in my case) using SSH with Putty (in my case with default xterm), how can I check if the terminal defintion from termcap or from terminfo was used? What to do if I want to use the other one by default accordingly (I have root rights)?


Ok, we have a couple bad assumptions to overcome here. Firstly both terminfo and termcap provide mappings between desired functionality and terminal control commands for multiple terminals. for example they answer the question how do I clear the screen on a televideo 922.

Secondly they are not used on a per session or per machine basis, they are used on a per application basis. What this means on a practical basis is that although you can tell if either library was used (ldd works great on dynamically linked libraries, or you can use strace/truss/… to see what files the program loads) and change which was used (source code modifications or wrapper libraries) in most cases it is not worth bothering with and much simpler just to make sure you have both databases installed for your terminal. this will work just fine since both use the TERM environment variable.

Specifically there is no default (aside from distribution policy but most use both).

If you were wanting to write an application that uses both, that is certainly possible but off topic fo U&L, instead ask on stack overflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.