Unfortunately, passing a startup to command to zsh
with -c
and keeping it open for interactive use (with -i
) doesn't work.
Disclaimer: The following solutions were tested from a regular Command Prompt (cmd.exe
), not cmder/conemu, though I'd expect them to work there too.
To try them from PowerShell (v3+), insert --%
as the first argument after (right after bash.exe
).
Here's a workaround:
c:/Windows/System32/bash.exe -c "zsh -c 'zstyle' && exec zsh -i"
Note that command zstyle
is executed in a different, transient zsh
instance, so this approach won't work for commands whose purpose is to modify the environment of the interactive shell that stays open.
If that is a requirement, things get more complicated (this solution courtesy of this answer):
c:/Windows/System32/bash.exe -c "{ { echo 'zstyle'; echo 'exec 0<&3-';} | zsh -i; } 3<&0"
Note, however, that both commands being executed will be printed before their output, if any, is shown, preceded by the prompt - as if the commands had been typed interactively.