Currently I am working on a feature to detect the kind of (pseudo)terminal people use.
My first idea is ask the /etc/alternatives/x-terminal-emulator
:
term=/etc/alternatives/x-terminal-emulator
test -e $term && file $term | ...
But I don't know if it can work well on OSX... Maybe there is a better method to detect it?
Will someone be willing to offer me more ideas about detecting the terminal people use?
You can use the
$TERM
variable which should be present on both *nix OSes and OSX. This variable is (normally) initialized by the system to let you know which terminal you're using.As a bonus you can use the
toe
command to find the list of terminal types recognized by the system.