I have to work with a script that forks and launches an instance of xterm in order to display log output in one window and have an interactive interface in the other. Personally I prefer rxvt-unicode and I would like to modify this script so that it is no longer hardcoded to use xterm.
Is it possible to either figure out the users preferred terminal in a desktop-agnostic way or to get the parent terminal. The parent terminal might not be the next parent in the process tree since it's possible that the script in question can in term be called by another script or application.
Since the script is written in Perl a solution written in Perl is good enough as long as it doesn't have weird dependencies (I can't control the global environment).
/etc/alternatives/x-terminal-emulator
link (if available on the platform).