Skip to content
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
3 changes: 0 additions & 3 deletions tmuxp/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
with_statement, unicode_literals

import os
import pipes
import logging

from .window import Window
Expand Down Expand Up @@ -108,7 +107,6 @@ def rename_session(self, new_name):
:rtype: :class:`Session`

"""
new_name = pipes.quote(new_name)
proc = self.tmux(
'rename-session',
'-t%s' % self.get('session_id'),
Expand Down Expand Up @@ -164,7 +162,6 @@ def new_window(self,
if start_directory:
# as of 2014-02-08 tmux 1.9-dev doesn't expand ~ in new-window -c.
start_directory = os.path.expanduser(start_directory)
start_directory = pipes.quote(start_directory)
window_args += ('-c%s' % start_directory,)

window_args += (
Expand Down
2 changes: 1 addition & 1 deletion tmuxp/testsuite/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

logger = logging.getLogger(__name__)

TEST_SESSION_PREFIX = 'tmuxp_'
TEST_SESSION_PREFIX = 'test tmuxp_'


def get_test_session_name(server, prefix='tmuxp_'):
Expand Down
31 changes: 27 additions & 4 deletions tmuxp/testsuite/workspacebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ class StartDirectoryTest(TmuxTestCase):
- echo "hey"
- shell_command:
- echo "moo"
- window_name: cwd containing a space
start_directory: /tmp/foo bar
layout: main-horizontal
panes:
- shell_command:
- pwd
- shell_command:
- echo "hey"
- shell_command:
- echo "moo"
- window_name: testsa3
layout: main-horizontal
panes:
Expand All @@ -405,6 +415,19 @@ class StartDirectoryTest(TmuxTestCase):
- echo "moo3"
"""

def setUp(self):
super(StartDirectoryTest, self).setUp()
if not os.path.exists('/tmp/foo bar'):
os.mkdir('/tmp/foo bar')
self._temp_dir_created = True
else:
self._temp_dir_created = False

def tearDown(self):
super(StartDirectoryTest, self).tearDown()
if self._temp_dir_created:
os.rmdir('/tmp/foo bar')

def test_start_directory(self):

sconfig = kaptan.Kaptan(handler='yaml')
Expand All @@ -416,10 +439,10 @@ def test_start_directory(self):
builder.build(session=self.session)

assert(self.session == builder.session)
for path in ['/usr/bin', '/dev/', '/usr/', os.getcwd()]:
for window in self.session.windows:
for p in window.panes:
self.assertTrue(p.get('pane_start_path', path))
dirs = ['/usr/bin', '/dev', '/tmp/foo bar', '/usr', os.getcwd()]
for path, window in zip(dirs, self.session.windows):
for p in window.panes:
self.assertEqual(p.get('pane_current_path'), path)


class PaneOrderingTest(TmuxTestCase):
Expand Down
2 changes: 0 additions & 2 deletions tmuxp/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
with_statement, unicode_literals

import os
import pipes
import logging

from . import util, formats, exc
Expand Down Expand Up @@ -378,7 +377,6 @@ def split_window(
if start_directory:
# as of 2014-02-08 tmux 1.9-dev doesn't expand ~ in new-window -c.
start_directory = os.path.expanduser(start_directory)
start_directory = pipes.quote(start_directory)
tmux_args += ('-c%s' % start_directory,)

if not attach:
Expand Down