Skip to content

Commit 8e37f6d

Browse files
committed
rename shell to window_command
1 parent 130b34a commit 8e37f6d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

libtmux/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def new_session(self,
397397
attach=False,
398398
start_directory=None,
399399
window_name=None,
400-
shell=None,
400+
window_command=None,
401401
*args,
402402
**kwargs):
403403
"""Return :class:`Session` from ``$ tmux new-session``.
@@ -435,7 +435,7 @@ def new_session(self,
435435
$ tmux new-session -n <window_name>
436436
437437
:type session_name: str
438-
:param shell: execute a command on starting the session. The
438+
:param window_command: execute a command on starting the session. The
439439
window will close when the command exits.
440440
NOTE: When this command exits the window will close. This feature
441441
is useful for long-running processes where the closing of the
@@ -486,8 +486,8 @@ def new_session(self,
486486
if has_gte_version('2.6') and 'TMUX' not in os.environ:
487487
tmux_args += ('-x', 800, '-y', 600)
488488

489-
if shell:
490-
tmux_args += (shell, )
489+
if window_command:
490+
tmux_args += (window_command, )
491491

492492
proc = self.cmd(
493493
'new-session',

tests/test_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ def test_new_session(server):
8989

9090

9191
def test_new_session_shell(server):
92-
"""Server.new_session creates and returns valid session running with specified command"""
92+
"""Server.new_session creates and returns valid session running with
93+
specified command"""
9394
cmd = 'sleep 1m'
94-
mysession = server.new_session("test_new_session", shell=cmd)
95+
mysession = server.new_session("test_new_session", window_command=cmd)
9596
window = mysession.list_windows()[0]
9697
pane = window.list_panes()[0]
9798
assert mysession.get("session_name") == "test_new_session"

0 commit comments

Comments
 (0)