Join setenv and source actions into one
It appears that tmux-1.6 is not able to function properly. Most likely this is because prior to some tmux version running shell commands in background is the default and only option and starting from some version `run-shell` does not run processes in background *by default*. This means that `source` action is run while `setenv` action is running and since `source` needs to load a bunch of configuration files, *including* importing a bunch of modules when creating renderer `source` and corresponding tmux actions are finished earlier. It is only a guess though: I am not even seeing race condition: `source` *is* run, `setenv` also *is*, but `source` is *always* before `setenv`.
This commit is contained in:
parent
70b1e342c4
commit
b23daa251c
|
@ -164,6 +164,11 @@ def init_tmux_environment(pl, args):
|
|||
' ' * powerline.renderer.strwidth(left_dividers['hard'])))
|
||||
|
||||
|
||||
def tmux_setup(pl, args):
|
||||
init_tmux_environment(pl, args)
|
||||
source_tmux_files(pl, args)
|
||||
|
||||
|
||||
def get_main_config(args):
|
||||
find_config_files = generate_config_finder()
|
||||
config_loader = ConfigLoader(run_once=True)
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
if-shell 'test -z "$POWERLINE_CONFIG_COMMAND"' 'set-environment -g POWERLINE_CONFIG_COMMAND powerline-config'
|
||||
|
||||
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux setenv'
|
||||
|
||||
# Simplify tmux version checking by using multiple config files. Source these
|
||||
# config files based on the version in which tmux features were added and/or
|
||||
# deprecated. By splitting these configuration options into separate files,
|
||||
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux source'
|
||||
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux setup'
|
||||
# vim: ft=tmux
|
||||
|
|
|
@ -21,6 +21,7 @@ class StrFunction(object):
|
|||
TMUX_ACTIONS = {
|
||||
'source': StrFunction(config.source_tmux_files, 'source'),
|
||||
'setenv': StrFunction(config.init_tmux_environment, 'setenv'),
|
||||
'setup': StrFunction(config.tmux_setup, 'setup'),
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue