def source_tmux_files(pl, args, tmux_version=None, source_tmux_file=source_tmux_file): '''Source relevant version-specific tmux configuration files Files are sourced in the following order: * First relevant files with older versions are sourced. * If files for same versions are to be sourced then first _minus files are sourced, then _plus files and then files without _minus or _plus suffixes. ''' tmux_version = tmux_version or get_tmux_version(pl) source_tmux_file(os.path.join(TMUX_CONFIG_DIRECTORY, 'powerline-base.conf')) for fname, priority in sorted(get_tmux_configs(tmux_version), key=(lambda v: v[1])): source_tmux_file(fname) if not os.environ.get('POWERLINE_COMMAND'): cmd = deduce_command() if cmd: set_tmux_environment('POWERLINE_COMMAND', deduce_command(), remove=False) try: run_tmux_command('refresh-client') except subprocess.CalledProcessError: # On tmux-2.0 this command may fail for whatever reason. Since it is # critical just ignore the failure. pass