118

Alt+Tab lets me only switch between windows belonging to different applications.

I often use about four terminal bound applications at the same time (e.g. IPython, VIM, fish for system and fish for git).

Even using the mouse, clicking the terminal icon on the launcher being offered takes time to decide which is which. But I don't know so far any way to switch in this case using my keyboard only.

How to handle multiple terminals (and instances of same application in general) efficiently using the keyboard?

With respect to the terminal special case - is there a terminal application allowing sperate terminals in tabs?


And the Oscar goes to ...

tmux

8
  • 2
    You can try Tiling window manager, such as i3wm. In i3 it is able to chnage window focus with $mod+hijk.
    – House Zet
    Feb 20, 2014 at 8:02
  • Define "efficiently"?
    – Braiam
    Feb 20, 2014 at 13:05
  • 9
    @Braiam: "efficiently" as in "Ubuntu reads my mind in speed of light, switches to the terminal I want to use and serves me coffee in case my awakeness level fell below 70%"
    – Raffael
    Feb 20, 2014 at 13:25
  • 3
    Instead of separate terminal windows, I'd learn tmux and create multiple windows and panes in a single terminal. It's fast, and customizable and scriptable to your hearts content.
    – Philip
    Feb 20, 2014 at 20:02
  • 5
    Possible duplicate of keyboard shortcut to switch between windows within an application
    – psukys
    Aug 9, 2016 at 21:36

15 Answers 15

128

In linux almost every terminal support tab, for example in Ubuntu with default terminal you can press:

  1. Ctrl + Shift + T or click File / Open Tab

  2. and you can switch between them using Alt + $ {tab_number} (*eg. Alt + 1)

also you might want to take a look at terminator

7
  • 1
    Perhaps better to talk about Ubuntu alone because xterm doesn't do tabs. And that counts a lot.
    – mike3996
    Feb 20, 2014 at 11:50
  • 1
    I know, that's why I've said - almost every terminal :) Feb 20, 2014 at 12:47
  • 2
    @progo It's not specific to Ubuntu, it's supported at least in gnome-terminal, konsole and several other widely-used terminals. AFAIK, gnome-terminal is default terminal in Ubuntu.
    – Ruslan
    Feb 20, 2014 at 13:24
  • not in xfce... does not work for Xubuntu...
    – Dee
    Feb 20, 2014 at 16:26
  • 5
    This does not answer the question. Tabs are useful, of course, but many uses cases for multiple windows (for example, iteratively running and editing code) requires being able to see the contents of both terminals at once. Aug 13, 2014 at 15:06
104

You can use Alt+tilde (tilde = Grave) to switch between windows of the current application. Note that tilde is always the key above tab, it is a tilde in an US english keyboard, but it can be anything in other languages.

If you press the Windows key for a while unity will show you all it's keyboard shortcuts in an overlay:

enter image description here

Finally, near all terminal applications support tabs. The default one in Ubuntu does.

6
  • 4
    This is the most intuitive answer, I think. I use this all the time.
    – don.joey
    Feb 20, 2014 at 13:08
  • The key above tab is tilde on (presumably) US English keyboards, it certainly is.;t with an en-GB keyboard layout.
    – Chris H
    Feb 20, 2014 at 13:27
  • This is not working for me at all. I'm using Ubuntu 14.04 installed on a MacBook Air, if that helps. Alt-Tab works, Alt-Tilde does not.
    – datakid
    Apr 19, 2015 at 8:25
  • Exactly what I was looking for!
    – kmario23
    Mar 23, 2017 at 21:21
  • The thing I don't like about ALT+~ is that you don't know the order it will switch to because the first press will jump to the most recent window, then it cycles through the rest of the windows. I wish there was the similar jumping shortcuts they have for tabs.
    – wisbucky
    Mar 27, 2017 at 22:15
40

Have you Tried to open multiple terminals using:

Ctrl + Shift + T

Then switching among them using:

Ctrl + PageUP

And

Ctrl + PageDown

I usually use this scenario at least for me

5
  • 3
    That is multiple tabs of one window , actually Oct 29, 2014 at 8:59
  • 1
    @Xieerqi Yes I know and it is the same as the accepted answer but I don't know why I didn't get an upvote at least
    – kamil
    Oct 30, 2014 at 14:58
  • Well, like I said - this answer is just related to one window, and user wanted switching between multiple windows so it makes some sense why your answer is ignored. I use this method all the time, though, so IMHO it's alright,too. Oct 30, 2014 at 15:55
  • in my case I had to put in a 'fn' to make above work but that won't be the case for every system
    – Junaid
    May 10, 2018 at 8:50
  • Thank goodness for this answer.
    – AturSams
    Mar 20, 2021 at 10:56
14

Not the answer you are looking for, but I think it's worth considering:
Instead of multiple tabs, you can use screen and byobu: enter image description here

screen lets you manage multiple terminals in the same window. In the previous image you can see I have 3 terminals (0 tcpdump, 1 top and 2 Node.js). You can switch between them with Ctrl+a+{index of the terminal} for example (there are a lot of commands).
byobu is a wrapper for screen, it adds some color, more commands and a help menu. But you can use screen alone, without byobu.
Here there is a tutorial on how to install and use screen and byobu:

1
  • 1
    If I may, I'll also add, that byobu works in tty consoles as well as in graphical environment. So useful, much indicators, wow ! Oct 30, 2014 at 15:57
7

Alt+` i.e. Alt+Tildeallows you to switch between the windows of the same application.

Or you can organize those windows in different workspaces and use the keyboard shortcuts to go to the proper workspace; I have four workspaces and use Ctrl+Alt+, Ctrl+Alt+, Ctrl+Alt+, Ctrl+Alt+ to switch between them. This could comparatively prove to be a faster way to go to the right application window when you have quite a few to handle.You can specify the number of workspace to be used in your system.

To swap the windows between the workspaces I use Shift+Ctrl+Alt+, Shift+Ctrl+Alt+, Shift+Ctrl+Alt+, Shift+Ctrl+Alt+.


These are some terminal emulators that allow multiple tab feature:

yakuakeSnap

5

In KDE it is Alt+`: System Settings → Workspace Appearance and Behavior → Window Behavior :

enter image description here

4

I suggest you to try out Guake, which can be installed from the software center

sudo apt-get install guake

Here's a screenshot

enter image description here

I personally switch tabs by using Ctrl+Page up and Ctrl+Page down, which is also the default as far as I remember.

Also I've bound Guake to the menu button, which I always considered useless. Now I can toggle the terminal with a single button and feel like I have super powers.

2

Create a new terminal window: Ctrl+Shift+n

Create a new terminal tab: Ctrl+Shift+t

Close a single terminal tab or window: Ctrl+d

Switch between terminal windows: Alt+ `

Switch between terminal tabs: Ctrl+ Page down (left), Ctrl+Page up (right), or Alt+#, e.g. Alt+1

0
1

Raffael asked:

is there a terminal application allowing seperate terminals in tabs?

I really like konsole for that.

Keyboard Shortcuts (which also can be changed!)

New Tab

  • STRG + Shift + T

Change Tab

  • Shift + Left / Right

Move Tab

  • STRG + Change Tab

Close Tab

  • Type 'exit' as often as you need or STRG + Shift + W

You can also split view (vertically or horizontally)

  • STRG + ( or ) (means for me STRG + Shift + 8 or 9)

and close split view

  • STRG + Shift + S

And try it together with Gnome Extension Putwindows

1

Switch between open instances of one program:

Alt + `

Switch between open tabs of one program instance:

Ctrl + Tab

Switch between programs:

Alt + Tab or Super + Tab

1

I've found alt + f6 works as well. This can also be changed to whatever keyboard shortcut you wish in settings by navigating to settings>devices>keyboard and scrolling to the shortcut: Switch windows of an app directly, found under the navigation heading.

0

Simply hold Alt (after releasing Tab and choosing CLI window(s)) a bit longer and you will get opportunity to choose between multiple CLI windows...

0

My workaround is to use xterm as wrapper. As much as I like grouping feature sometimes a window better to be ungrouped. I.e. I use midnight commander as a file manager and it goes grouped with other terminal windows which is not nice

So what I did is:

  1. leave gnome-terminal as default terminal app
  2. edit /usr/share/applications/mc.desktop to execute mc within xterm session Exec=xterm -geometry 152x42 -fa 'Monospace' -fs 19 -T "Midnight Commander" -n "Midnight Commander" -e mc

You can do something like this to your app. Having it wrapped to xterm makes it to be put to separate group under alt-tab. Its not a flawless solution, you'll need to deal with colour scheme, copying to buffer may give you a troble, but generally its an ok workaround.

0

Following commands will help you a lot:

Create new terminal window in user directory: Ctrl + Alt + T

Create new terminal window in current working directory: Ctrl + Shift + N

Create new terminal tab in current working directory:Ctrl + shift + T

Minimize a terminal window or (any open window) : super(window key) + H

Switch between windows of different apps: Alt + tab

Switch between windows of terminal(windows of current open app): Alt + tilde

0

Here is a trick that I use:

  1. Install two (or more) different terminal applications and put both of them into your favourite activities list (the list on the left side of your screen). Put them at the top so that they would get assigned numbers 1 and 2:

enter image description here

  1. Pressing windows + 1 / windows + 2 will let you switch between the first / second terminal applications.

In this way, you can shift between console screens using a keyboard without losing the view of the previous one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .