How to trick a program into thinking there is no X server running

x11

I have this program that can run with both a text user interface and a graphical user interface.

It lacks any command line switch to force one or the other, rather I guess it somehow auto-detects whether we are in X or not (e.g. if I run it from a virtual terminal it enters its text mode, and if I run it from an X terminal emulator it opens a separate graphical window).

I'd like to force it into text mode and have it run inside the X terminal. How would I go about doing it?

Best Answer

Usually just

unset DISPLAY

in command-line of the terminal. Some applications are smarter than that, and actually check permissions and type of the console versus pseudoterminal.

Related Question