parent
034b7d529d
commit
9f7e59d0cf
|
@ -4,6 +4,7 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from powerline.config import POWERLINE_ROOT, TMUX_CONFIG_DIRECTORY
|
from powerline.config import POWERLINE_ROOT, TMUX_CONFIG_DIRECTORY
|
||||||
from powerline.lib.config import ConfigLoader
|
from powerline.lib.config import ConfigLoader
|
||||||
|
@ -75,7 +76,12 @@ def source_tmux_files(pl, args):
|
||||||
cmd = deduce_command()
|
cmd = deduce_command()
|
||||||
if cmd:
|
if cmd:
|
||||||
set_tmux_environment('POWERLINE_COMMAND', deduce_command(), remove=False)
|
set_tmux_environment('POWERLINE_COMMAND', deduce_command(), remove=False)
|
||||||
run_tmux_command('refresh-client')
|
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
|
||||||
|
|
||||||
|
|
||||||
class EmptyArgs(object):
|
class EmptyArgs(object):
|
||||||
|
|
|
@ -50,7 +50,12 @@ def set_tmux_environment(varname, value, remove=True):
|
||||||
'''
|
'''
|
||||||
run_tmux_command('set-environment', '-g', varname, value)
|
run_tmux_command('set-environment', '-g', varname, value)
|
||||||
if remove:
|
if remove:
|
||||||
run_tmux_command('set-environment', '-r', varname)
|
try:
|
||||||
|
run_tmux_command('set-environment', '-r', varname)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
# On tmux-2.0 this command may fail for whatever reason. Since it is
|
||||||
|
# critical just ignore the failure.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
NON_DIGITS = re.compile('[^0-9]+')
|
NON_DIGITS = re.compile('[^0-9]+')
|
||||||
|
|
Loading…
Reference in New Issue