I'm trying to open up a few terminal tabs in gnome-terminal, and so far I've managed to do something, but I'm stuck now.
So, I have the following requirement:
- Open tabs titled "X" and "Y"
- Execute some commands
- Keep the tabs open and ready for further use; keep the title.
So far, I managed to meet some of the requirements, but not all of them:
gnome-terminal --tab -t "X" -e "bash" --tab -t "Y" -e "top"
This opens two tabs:
- "X" (and then changes the title to the default title)
- "Y", but the tab closes as soon as I quit
top
.
Is there a way to open up a tab, launch bash
, but not change the title? I've tried Google, but gave up.
EDIT: It doesn't has to be a command.
Best Answer
As you can see in other answers, the title of the tab is changed by the shell every time it outputs a prompt. And after executing
top
your tab exits because the command you told it to run finishes...I'll do the following:
Step 1: call the terminal with shells, adding environment variables like that:
Step 2: add at the end of your
.bashrc
the following code:...which I think is easy to understand and you can modify with the command/tweaks you need. Tested and works ok; after you exit
top
from the tab you'll still have the prompt and the tab for you to peruse.Screenshot (after pressing "q" in
top
):