Skip to content

Commit c47aee1

Browse files
authored
Merge pull request #490 from tmux-python/issue_475_fix
Set XDG_CONFIG_HOME tmux config path correctly if XDG_CONFIG_HOME in use
2 parents 9e1212f + 9e73aa3 commit c47aee1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/test_cli.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ def test_tmuxp_configdir_env_var(tmpdir, monkeypatch):
120120
assert get_config_dir() == tmpdir
121121

122122

123+
def test_tmuxp_configdir_xdg_config_dir(tmpdir, monkeypatch):
124+
monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir))
125+
tmux_dir = tmpdir.mkdir("tmuxp")
126+
127+
assert get_config_dir() == str(tmux_dir)
128+
129+
123130
def test_resolve_dot(tmpdir, homedir, configdir, projectdir, monkeypatch):
124131
monkeypatch.setenv('HOME', str(homedir))
125132
projectdir.join('.tmuxp.yaml').ensure()

tmuxp/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_config_dir():
5050
if 'TMUXP_CONFIGDIR' in os.environ:
5151
paths.append(os.environ['TMUXP_CONFIGDIR'])
5252
if 'XDG_CONFIG_HOME' in os.environ:
53-
paths.append(os.environ['XDG_CONFIG_HOME'])
53+
paths.append(os.path.join(os.environ['XDG_CONFIG_HOME'], 'tmuxp'))
5454
else:
5555
paths.append('~/.config/tmuxp/')
5656
paths.append('~/.tmuxp')

0 commit comments

Comments
 (0)