35

I have a ConEmu {Task} that opens several tabs, each to a different directory. The trouble is, these tabs all have the same name and are hard to tell apart. I know I can rename each tab by right-clicking it and selecting rename*, but is there a way of renaming each one automatically via the task configuration?

It would be super-handy being able to:

a) specify a custom title;
b) specify a variable title using the current directory.

(*what is the Apps+R shortcut, btw? I've never come across the Apps key before.)

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
Charles Roper
  • 10,599
  • 16
  • 56
  • 75

2 Answers2

48

1) Modify contents of your task. Example:

>cmd /c RenameTab "Tab1" & tcc cdd C:\temp
cmd /k RenameTab "Tab2" & cd /d D:\
cmd /c RenameTab "Tab3" & stermc charlesr ...

And so on... Supposing, that %ConEmuBaseDir% exists in %PATH%. This can be done automatically with last ConEmu versions (option on ComSpec settings page).

More short and preferable alternative is available in build 121109 or higher

>tcc cdd C:\temp "-new_console:t:Tab1"
cmd /k cd D:\ "-new_console:t:Tab2"
stermc charles "-new_console:t:Tab3"

2) As for CD in title, you may use usual method. This works for cmd and tcc consoles. Example:

tcc prompt $E]2;"$P"$E\$P$G & cdd D:\
cmd prompt $E]2;"$P"$E\$P$G & cd /d D:\

Don't use 1 and 2 simultaneously. RenameTab has precedence!

Maximus
  • 20,637
  • 16
  • 91
  • 116
  • Wow, I didn't think it was possible - thank you. Having said that, 2) isn't working for me - it doesn't change the tab name. Could you possibly show what it should look like in your {Tasks} config? – Charles Roper Aug 09 '12 at 07:38
  • Note! `prompt $E]2;"$P"$E\$P$G` change console title, not rename tab. Rename tab has priority. http://i.imgur.com/UCl3R.png http://i.imgur.com/A0WwJ.png – Maximus Aug 09 '12 at 07:41
  • 6
    New switch introduced, answer updated. – Maximus Nov 12 '12 at 18:15
  • I added this to my powershell profile, see here: https://github.com/majkinetor/powershell_profile.d/blob/master/10_prompt.ps1#L11 – majkinetor Oct 19 '16 at 10:04
0

Have you tried using:

title your-desired-tab-name

I tried it on my conemu and it works just fine. Just input those commands on the command line of conemu.

catzilla
  • 101
  • 2