Allow to create specific terminal applications (replace deprecated --class CLI option)
This is a copy of https://bugzilla.gnome.org/show_bug.cgi?id=779315
The same way GNOME Web (epiphany) allows to create web application, that encapsulate a specific web instance pointing to a specific page in a GNOME application (with a specific launcher icon and specific grouping when switching windows in GNOME), the Terminal should also allow to do that.
Previously, this was possible to do it manually, with the WMClass= .desktop property and the --class command line argument. This is no longer possible however, due to the deprecation of --class.
They do this using a switch --application-mode that probably changes the window manager class underneath, and by giving a profile location. Terminal could use profiles in the same way, with a similar switch to make it a specific application registered to the window manager.
Basically, --application-mode has to lookup the profile for the window manager class before it initializes the Gtk application. So it can start the application with the proper WM class.
Note that the terminal is very similar to the web browser. Both are user interfaces for third party application. A web browser leverages the complete web stack for that. The terminal uses the tty and specific escape characters. But the intent is the same for both: show content that comes from elsewhere.
So, it makes sense to have the same kind of features for both.