7

i've configuring my ConEmu + Cygwin enviroment. I've created a task, when i start it in a tab, the task will run a batch file, which in turn will change dir into cygwin and run

bash --login -i my_ssh_entry_script.sh

Inside my_ssh_entry_script.sh, it will read a config file in my home directory then print a menu for me to select which host to connect. And finally

...
exec ssh -p$port $userhost

Now i can work on the selected machine in the same conemu tab. This works fine. And the script also works on linux machine too.

But there is a little flaw. I can't change the tab's title. I've tried to change it to:

....
exec $(cygpath ${ConEmuDir})/ConEmu.exe /cmd ssh -p$port $userhost -cur_console:t:$title

But this will always create a new tab. Any suggestion to slove it? Thanks~

jayven
  • 770
  • 8
  • 19

2 Answers2

10

1) You need GuiMacro, thoroughly described in the project wiki: http://conemu.github.io/en/GuiMacro.html

ConEmuC -GuiMacro Rename 0 "Title"

2) You do not need to run batch. It causes extra and useless cmd.exe in yours process tree. You can do all required "CD" and "SET" from the task content directly.

Maximus
  • 10,751
  • 8
  • 47
  • 65
  • Great, it works! And there's no need to run batch indeed. Thanks @Maximus, thanks for your awesome tool ;-) – jayven Jul 28 '14 at 12:27
  • Becaue Google Code has migrated now to Github and the provided URL from Maximus isn't anymore correct the new Url for more information: [http://conemu.github.io/en/GuiMacro.html](http://conemu.github.io/en/GuiMacro.html) Command works still. – Tobias Hochgürtel Sep 20 '15 at 13:20
4

At least for cmd shell: "-new_console:d:C:\Users\dir_name" cmd /V /K -new_console:t:Tab_renamed