This should fix#61. Previously when you manually ran `tmuxifier
load-window` from within a session created by Tmuxifier, the
`session_root` path set in the session was ignored, and the new window
would be cd'd to `$HOME` unless the window configuration had
`window_root` set.
Previously $window was only set by the new_window() helper when it was
passed a name argument. This caused weird behavior cause if it was
called without a name it would simply attempt to recreate the same
window and fail. That was until @blueyed's fix in 2249cf8.
However, the $window var still wasn't being set correctly, leaving
split_v(), split_h() and other helpers to operate on the wrong
window. This is no longer an issue as $window is always set to the index
of the currently active window at the end of new_window() and
select_window().
When using Tmux 1.9 and later the "-c" argument is given to the
"new-session" command to set the session's root/default path. When using
Tmux 1.8.x and earlier, the old "default-path" session option method is
used instead.
Resolves issue #20. Additionally, load_session now has an optional
second argument to set the default session name. And error output from
both load commands is now printed to STDERR and give a return code of 1
on error.
added split_hl and split_hl and split_vl which split with a count of
columns/lines instead of by percentage, and clock which starts
clock-mode. Comments for each added.
This means that "init" session layouts can now be used to start and/or
re-attach to your main session.
Personally I have a "main" session layout with a couple of default
windows. I can now either start that session, or re-attach to it from
outside of Tmux by just running `tmuxifier s main`, instead of manually
creating a session named "main" and then loading my windows into it.
Instead of assuming that the default created window in a new session has
a index of `0`, we now check window index for the session with Tmux's
list-windows command.
Additionally, the default window is now moved to index `999` instead of
`99`, cause I'm paranoid and probably stupid :)
After some experimentation it turns out that if input to send-keys is
not a known key sequence like `C-m` or `C-l` for example, it it
automatically treated as literal input.
Negating the need to use it and hence check if it's supported.