when I work I usually have a terminal with many tabs open. For example, the first tab is for my web server, the second for the console, the third for the models etc.

Every time I have to manually open the new Tab (I use Ctrl + Shift + T), I right click on the tab label and rename it (Web Server, Console, Models, etc.).

However I would like to automate this, but I can't find the commands to:

  • Open the new tab from within the current prompt,
  • Rename it

Since I would like to make a BASH script for that, what can I use?

  • Excellent question! I don't know the answer but I can tell you some things that might help. Tabs are something your terminal emulator does, so the answer will be different for gnome-terminal vs Guake (for example).
    – RJHunter
    Oct 2, 2014 at 14:16

1 Answer 1


You could have all three showing in one terminal window (no tabs) with TMUX.

A terminal multiplexer would be the easiest way to accomplish this and automate it. After installing TMUX, create file that will hold the directives (this does not need to be executable). The contents of the file can change when you become more familiar with TMUX.


    new-session -s workspace -d
    split-window -v -t workspace
    split-window -h -t workspace
    select-layout -t workspace main-horizontal
    send-keys -t workspace:1.1 'ssh webserver.fqdn' C-m

This will create your TMUX session, split into three panes in the same window, change the layout, and then ssh into your webserver in the first pane of the first window. To launch:

    $ tmux -f ~/path/to/file/above attach

Controlling this session is much like screen in that it has escape sequences to send commands to tmux in order to attach, move between panes within the window, moving between windows, etc... Full use/customization of this environment is beyond the scope of this question. I highly suggest reading the documentation.

Link: http://tmux.sourceforge.net

  • Yes I know, I can use a multiplexer, thanks, but I like the tabs since I can rename them, and I would like if it's possible to code a solution specific for this case.
    – Moleskine
    Oct 3, 2014 at 8:41
  • Else I don't really know about TMUX, but screen is already a great choice tha I've used for long and I would suggest myself.
    – Moleskine
    Oct 3, 2014 at 8:42

You must log in to answer this question.

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