Tmux is a convenient terminal multiplexer, not until recently Cygwin has packed Tmux in its distribution source, now we can install Tmux from setup-x86{_64}.exe, the package installer provided by Cygwin.

One problem I experienced while using tmux is that: every time I created a new window in Tmux, the working directory is always HOME, even if I specified the startup directory in the option:

Having examined this problem for a while, I can now tell what is wrong.

If a shell is launched as a login shell in Cygwin, the working directory is always set to HOME by the default configuration.

To avoid the unexpected behaviour, we can configure Tmux like this:

Add the above line to your ~/.tmux.conf to make it permanent.

The rationale can be found in the manpage of tmux:

default-command shell-command

Thus, setting a non-empty default-command prevents the shell being made into a login shell, the problem is worked around.