Rename tab from MinGW-console using ConEmu

I'm using the cmder (ConEmu) with Git Bash-tabs (MinGW) and I want to rename the current tab with a console command. Within a cmd-Tab I can use cmd /c RenameTab "myTabName" but I a need a similar command for the Git Bash.

The reason for this is as follows: besides for Git I'm using the Git Bash for connecting to several servers using the ssh-command, opening ssh connections to multiple servers on multiple tabs. To maintain an overview on which server I am in which tab I have to rename each tab manually using a shortcut for the rename tab function in the cmder. My ultimate goal would be to use a script which would open a ssh Connection with the command "ssh serverxyz" and also renames the current tab to "serverxyz" at the same time.

Thanks for any help.


Solution 1:

Use GuiMacro:

ConEmuC -GuiMacro Rename 0 "serverxyz"

Solution 2:

echo -ne '\e]0;title here\a'

Replace "title here" with what you want the title to be. That's arguably uglier than GuiMacro's solution but should work on more platforms too.

Edit: Maximus said this doesn't work but I use it in my scripts all the time. Turns out it only works in a script, as soon as the script is done executing ConEmu overwrites the title with the cwd.