The pane_base_index and base_index options are set and handled
independently in tmux, so the value of pane_base_index should not
override the value of base_index (as it previously was).
The startup_window and startup_pane options were not behaving correctly
for users running tmuxinator from within an existing tmux session.
Tmuxinator would generate commands like 'tmux select-window -t 1', which
would target the current session instead of the target (project)
session. This bug is fixed by specifying full paths
(session:window.pane) for the startup_window and startup_pane.
Tmuxinator currently fails to find a value for this option, because
pane-base-index is a window option, not a session option: the -w flag
must be passed to 'tmux show-option' in order to display it. This patch
fixes the issue with two changes to the #show_tmux_options method of
Tmuxinator::Project:
1. It now displays both global session options and global window
options.
2. It now **only** detects the options that Tmuxinator::Project knows
and cares about (currently base-index and pane-base-index)
Reword pre and post settings as on_start and on_detach; this acheive
two objectives: is semantically clearer after adding "hooks" and moves
the code all to the Tmuxinator::Hooks module.
As suggested in #476, would be useful to be able to specify command at
different stages of tmux session. Hooks are an effective way to execute
specific commands when specific events occurs. In particular it adds
on_detach, on_reattach, and on_stop hooks, to terminate or bootstrap
processes and daemons on session events.
Allow existing code to work with renamed methods
Deprecated methods: ignore the 1st, use the 2nd
alias :root :directory
alias :project_in_root :global_project
alias :project_in_local :local_project
Resolve Issue #462 - "Tmuxinator config files in a different location"
Resolve Issue #360 - "XDG base directory support"
Mentioned in Issue #427 - "Introduce Analytics Module"
Allow `$TMUXINATOR_CONFIG` to specify a configuration directory, which
will be created if it doesn't exist. This directory takes preference
over honouring the XDG specification (below). If specified, this will be
the only configuration location used.
Honour the [XDG Base Directories Specification]
(https://specifications.freedesktop.org/basedir-spec/latest/) with
regards to user specific configuration files: Look for `tmuxinator`
configuration files under `$XDG_CONFIG_HOME/tmuxinator`.
For existing setups with no `$XDG_CONFIG_HOME` directory, continue to
create new projects in `~/.tmuxinator` for backwards compatibility.
If `$XDG_CONFIG_HOME/tmuxinator` exists, create new projects there.
If neither `~/.tmuxinator` nor `$XDG_CONFIG_HOME/tmuxinator` exist, use
`$XDG_CONFIG_HOME/tmuxinator` for new projects.
When loading a project, search `$XDG_CONFIG_HOME/tmuxinator` before
`~/.tmuxinator`. Document in comments and tests the existing behaviour
of returning only the first project file found in a recursive search of
a configuration directory.
Add Config#directories: an array of the configuration director{y,ies}
which exist. Update commands `implode` and `list` to operate upon this
array.
Rename `Config#root` -> `Config#directory`
This directory is the only one used when creating new project files, and
may be either `$TMUXINATOR_CONFIG`, `$XDG_CONFIG_HOME/tmuxinator` or
`~/.tmuxinator`.
Implementing XDG Base Dirs support with backwards compatibility means
that two directories may contain project files, making the `root`
nomenclature misleading as it implies a single directory.
Rename `Config#project_in_root` -> `Config#global_project`
See comment on `root` terminology above. `global_project` is also
shorter and corresponds to the naming of `default_project`
Rename `Config#project_in_local` -> `Config#local_project`
Fit with the naming of both `global_project` and `default_project`