Skip to content

Bug start directory #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ current
-------
- *Insert changes/features/fixes for next release here*

tmuxp 1.5.8 (2020-10-31)
-----------------------
- :issue: `631` Passes start_directory through to new tmux session

tmuxp 1.5.7 (2020-10-31)
------------------------
- :issue:`637` Support for loading directories with periods in it
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ skip-string-normalization = true

[tool.poetry]
name = "tmuxp"
version = "1.5.7post0"
version = "1.5.8"
description = "tmux session manager"
license = "MIT"
authors = ["Tony Narlock <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def test_import_tmuxinator(cli_args, inputs, tmpdir, monkeypatch):
(['freeze'], ['\n', 'y\n', './exists.yaml\n', './la.yaml\n', 'y\n']), # Exists
( # Create a new one
['freeze', 'mysession', '--force'],
['\n', 'y\n', './la.yaml\n', 'y\n']
['\n', 'y\n', './la.yaml\n', 'y\n'],
),
( # Imply current session if not entered
['freeze', '--force'],
Expand Down Expand Up @@ -554,7 +554,7 @@ def test_freeze(server, cli_args, inputs, tmpdir, monkeypatch):
),
( # Imply current session if not entered
['freeze', '--force'],
['\n', 'y\n', './exists.yaml\n', 'y\n']
['\n', 'y\n', './exists.yaml\n', 'y\n'],
),
],
)
Expand Down
2 changes: 1 addition & 1 deletion tmuxp/__about__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.5.7post0'
__version__ = '1.5.8'
__description__ = 'tmux session manager'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
Expand Down
12 changes: 9 additions & 3 deletions tmuxp/workspacebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,15 @@ def build(self, session=None):
'Session name %s is already running.' % self.sconf['session_name']
)
else:
session = self.server.new_session(
session_name=self.sconf['session_name']
)
if 'start_directory' in self.sconf:
session = self.server.new_session(
session_name=self.sconf['session_name'],
start_directory=self.sconf['start_directory'],
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's late so I don't want to dredge this up, do we want/need a test for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy merging without a test, I can write one later if we need it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. It would probably be a good idea to write a test just so we have it

else:
session = self.server.new_session(
session_name=self.sconf['session_name']
)

assert self.sconf['session_name'] == session.name
assert len(self.sconf['session_name']) > 0
Expand Down