0

I am having an issue with the tabs retaining their custom titles.

Here is my script:

gnome-terminal \
  --tab --working-directory="${HOME}/git/project-1" -t "Project #1" \
  --tab --working-directory="${HOME}/git/project-2" -t "Project #2" \
  --tab --working-directory="${HOME}/git/project-3" -t "Project #3"

When the terminal first opens, I see all the tabs with their custom titles then they switch to their fully-qualified paths after their working directory is set.

  • user@~/git/project-1 instead of Project #1
  • user@~/git/project-2 instead of Project #2
  • user@~/git/project-3 instead of Project #3

Edit

I even tried this, but it didn't work either. At the very least it opened the first tab, but still changed the title of the tab.

gnome-terminal \
  --tab -t "Project #1" -- bash -c "cd ~/git/project-1; bash" \
  --tab -t "Project #2" -- bash -c "cd ~/git/project-2; bash" \
  --tab -t "Project #3" -- bash -c "cd ~/git/project-3; bash"

References

1 Answers1

0

I've found this solution (but I can't remember where). Maybe this is what you need.

Comment in you .bashrc this lines:

# If this is an xterm set the title to user@host:dir
: '
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
'