Pregunta

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\""
¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top