How to close a GNOME terminal tab from the keyboard?

When the shell process inside the terminal tab exits, it will close. If it was the only tab, the entire window will close. So you just have to quit the Bash session.

Your Bash session quits...

  • when you type the command exit.
  • when you press Ctrl+D to send an EOT ("End Of Transmission") code.
    Note that it must be pressed when the command prompt is empty, i.e. you haven't typed anything else on that line yet.

Please also note that you can nest multiple interactive shells. You can start a new shell inside the current one by running e.g. bash, sh, python, bc, ... The exit and Ctrl+D will always only terminate the currently active shell, which is usually the innermost one.


From the GNOME Terminal help:

  • Close Tab: ShiftCtrlW
  • Close Window: ShiftCtrlQ

You already mentioned it, type exit and the tab (as well as the terminal session running within the tab) will be closed.