How do I detect if I'm in a 'full screen' bash shell or GUI terminal window?

Posted by Nick T on Ask Ubuntu See other posts from Ask Ubuntu or by Nick T
Published on 2013-09-23T21:01:13Z Indexed on 2013/10/29 4:17 UTC
Read the original article Hit count: 395

Filed under:
|

I have some code in my .bashrc that sets the terminal window title using the currently running command and it works great in Unity, where the terminal is in a window. However, when I'm logging in with the Ctrl + Alt + F1 terminal (whatever it's called), my prompt gets filled with garbage that is various escape sequences that set the (nonexistent) window title.

How can I detect from within a bash script if I'm in one or the other?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about bash