Starting Zsh in ConEmu in specified directory

3

2

ConEmu runs zsh under CygWin fine.

I want to add a right click option to explorer to "Start ConEmu With CygWin Zsh In This Diretory"

ConEmu provides an Integration settings page to set explorer context menu integration commands, but I can't work out what to put in the Command field to open zsh in the current directory under the Command field.

To open git msys bash, '"%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i' works, and bash opens in the directory open in Windows explorer, but if I try '"C:\CygWin\bin\zsh.exe" --login -i' it opens ZSH, but zsh always starts in ~/ instead of the folder open in Explorer.

panac

Posted 2015-03-14T17:50:17.807

Reputation: 31

Answers

2

The new method is to use CHERE_INVOKING environment variable to avoid changing current directory:

SET CHERE_INVOKING=1 & c:\cygwin\bin\zsh.exe --login -i

See the details in ConEmu documentation.

ruvim

Posted 2015-03-14T17:50:17.807

Reputation: 137

1Also this method allows you to run zsh just once rather that running a nested zsh inside another zsh instance like the other one does, and you won't get the "root process ran for less that 10 seconds" warning if you close conemu quickly. – Alexander Revo – 2019-10-27T09:52:30.820

2

I ran into the same issue and never got the working directory flag to open zsh in the specified directory. My workaround was to execute a cd command as part of the task's config:

C:\CygWin\bin\zsh.exe --login -i -c "cd C:\my\working\directory; exec zsh"

dallinski

Posted 2015-03-14T17:50:17.807

Reputation: 21