title: How to check which program runs inside gnome-terminal
body: <p>I want to write a program which prints the current focused window name and if it is a gnome-terminal, then prints out the running program inside the current gnome-terminal tab (for example vim, if a vim session is running).</p>
  
  <p>To get the currently focused window name, I used:</p>
  
  <blockquote>
    <blockquote>
      <p>xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"</p>
      
      <p>xprop -id  0x220ad5a | grep "WM_CLASS(STRING)"</p>
    </blockquote>
  </blockquote>
  
  <p>If the current window is a gnome-terminal, this will return 'gnome-terminal'. </p>
  
  <p>But how can I find out the program running inside gnome-terminal (more precisely: inside the current gnome-terminal tab)?  I thought about using dbus but gnome-terminal does not seem to support it.</p>