How can I start the gnome-terminal with multiple tabs with always the same title and history?

Sadik

I want to start the bash with 4 tabs, having different titles. In all of them I'm working in different directories so it would be useful if I can cd to different paths.

Now it would be also great to save the history separately for every tab. So that every tab only remembers the commands I ran on it, even after a reboot.

Currently I have a script which starts gnome-terminal with 4 tabs.

gnome-terminal --geometry=150x50 --tab --title="src" -e "bash -c \"cd "~/path/to/src";exec bash\"" --tab --title="first test" -e "bash -c \"cd "~/path/to/single-test-dir";exec bash\"" --tab --title="test3" -e "bash -c \"cd "~/path/to/testdir";exec bash\"" --tab --title="test4" -e "bash -c \"cd "~/path/to/somewhere";exec bash\""
kevoroid

I suppose you can use a gnome-terminal custom command for each profile, for example

bash -c 'PROFILE=default_profile exec bash'

or

bash -c 'PROFILE=screen_profile exec screen -U'

or similar.

Then in ~/.bashrc

if [[ -n $PROFILE ]]; then
    HISTFILE=~/.bash_history."$PROFILE"
fi

source of the answer.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I start a script in a minimised Gnome Terminal?

How do I clear the Gnome terminal history?

How can I get multiple instances of GNOME Calculator at same time?

Fedora / GNOME: Can I get the title bar to always be at the top?

How do I alternate tabs in Linux GNOME terminal?

Start gnome-terminal with predefined history

Opening multiple tabs with gnome-terminal

How can I save my multiple tabs session in an xfce4-terminal?

How can I make Guake terminal and Terminator as beautiful as gnome terminal

How do I start gnome-terminal with a specific width/height?

How to set the initial number of columns in gnome-terminal when opening multiple tabs?

How to change Gnome-Terminal title?

How can I make a terminal with 3 tabs appear after startup?

How can I change the keyboard shortcut for switching tabs in Mac Terminal?

Can no longer set terminal title in Ubuntu 16 (gnome-terminal)

How can I clone a terminal and retain its current history?

How can I see a history of the terminal output, not just commands entered?

How to stop getting error message and two tabs when I ctrl + click on a link in gnome terminal

How can I launch the GNOME image viewer from the terminal?

How can I change gnome terminal font in command line?

How can I upgrade gnome-terminal on Ubuntu 14.04 LTS?

How can I create a new Gnome Terminal profile?

How can I make gnome-terminal not transparent?

How can I disable auto scrolling in gnome terminal?

How can I feed clipboard content to gnome-terminal?

How can I programmatically get the PID of the active GNOME Terminal instance?

How can I change the color of my cursor in gnome-terminal?

How can I use gnome-terminal in qt creator?

Is it possible to start gnome-terminal always in fullscreen mode without menubar?