8

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.

2 Answers 2

9

Use GuiMacro:

ConEmuC -GuiMacro Rename 0 "serverxyz"
1
  • 2
    That's exactly what I was looking for. Thanks a lot! Commented Oct 18, 2014 at 14:12
1
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.

3
  • The question is about Windows platform and mingw started in ConEmu tab. That will not rename tab title. It may change only console title, but it may be immediately changed by PS1, PROMPT_COMMAND and others.
    – Maximus
    Commented Oct 19, 2014 at 8:45
  • @Maximus good point. I was always using this in the context of a script so it was working fine for my purposes, but you're right it doesn't seem to be a general solution. Updated my answer. Commented Oct 20, 2014 at 16:55
  • This works for me and I tested it under cygwin and msys2. I put it in precmd() Commented May 9, 2016 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .