I have a C++ program and I want to determine whether the parent process is a terminal or not. Because if it is a terminal, I can use escape codes to highlight the output, else this will be displayed with unreadable characters. The solution need to run on any posix system.
If anyone knows the solution for Java I would be interested in it as well.