4

I want to explicity rename a tab in gnome-terminal on startup of the tab. I don't want to use gnome-terminal --title flag as that gets reset by my systems bashrc file after whatever else is supposed to run.

I have used this command with success in a normal terminal

export PROMPT_COMMAND="echo -ne '\033]0;TABNAME\007'"

This command works fine to rename the current tab's name, but when I try to use it in conjunction with gnome-terminal execute command, I am not getting proper output.

I have used gnome-terminal --e flag to execute simple commands with success, something like this will bring up a new terminal and echo hey then return to bash

gnome-terminal -e "bash -c 'echo hey';bash"

Here is what I am trying note the escaped " " marks that I added

TABNAME="export PROMPT_COMMAND=\"echo -ne '\033]0;TABNAME\007'\""
gnome-terminal --tab --e "bash -c $TABNAME;bash"

I always get weird output no matter how I change the quotes, but I think that is where the problem is.

0

You must log in to answer this question.