Gnome Terminal allows to have different profiles. Is it possible to get the profile name under which that terminal started from the command line?
Access the name of the gnome terminal profile from the command line
gnomegnome-terminal
gnomegnome-terminal
Gnome Terminal allows to have different profiles. Is it possible to get the profile name under which that terminal started from the command line?
Best Answer
This doesn't seem to be possible, however you can find out the default terminal title, so all you need to do to distinguish between tabs or profiles is to configure different default titles.
The control sequence
ESC [ 2 1 t
asks the terminal to insert its title on the terminal input stream. (See Xterm control sequences for more information about escape sequences for xterm and similar programs). Specifically, the terminal (if it supports this feature; gnome-terminal does) responds withESC ] l title ESC \
.Here's a bash function that sets the variable whose name is passed as the first argument to the xterm title, if available. It times out after one second if the terminal doesn't support the feature, and returns a non-zero error code.