Skip to content

Commit 7f6edc7

Browse files
committed
#33 simplify start_directory expansion.
1 parent ec70b75 commit 7f6edc7

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

tmuxp/config.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,10 @@ def expand(sconf, cwd=None):
171171
# Any config section, session, window, pane that can contain the
172172
# 'shell_command' value
173173
if 'start_directory' in sconf:
174-
if (
175-
any(sconf['start_directory'].startswith(a) for a in ['.', './']) or
176-
any(sconf['start_directory'] == a for a in ['.', './'])
177-
):
178-
start_path = os.path.normpath(
179-
os.path.join(cwd, sconf['start_directory'])
180-
)
174+
start_path = sconf['start_directory']
175+
if any(start_path.startswith(a) for a in ['.', './']):
176+
start_path = os.path.normpath(os.path.join(cwd, start_path))
177+
181178
sconf['start_directory'] = start_path
182179

183180
if (

tmuxp/testsuite/test_workspacebuilder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ def test_focus_pane_index(self):
196196
proc = self.session.tmux('show-option', '-gv', 'base-index')
197197
base_index = int(proc.stdout[0])
198198
self.session.server._update_windows()
199-
for w in self.session._windows:
200-
logger.error(w['window_index'])
201199

202200
window3 = self.session.findWhere({'window_index': str(base_index + 2)})
203201
self.assertIsInstance(window3, Window)

0 commit comments

Comments
 (0)