diff options
author | Peter Seebach <peter.seebach@windriver.com> | 2013-06-11 09:28:03 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-11 15:55:58 +0100 |
commit | 1f99e74e00ba87cfd297536ca25c6fb3a8b63a44 (patch) | |
tree | 298d8f9511cdb197b6c7b9d2b3f61b6172925ef6 | |
parent | 69a6023502fb5830e2f103041985cb72e33806dd (diff) | |
download | poky-1f99e74e00ba87cfd297536ca25c6fb3a8b63a44.tar.gz |
handle two-word commands with tmux
Trying to make a devshell using tmux can fail because "tmux new"
expects a single command, not a series of arguments. It does, however,
split strings in a suitable way. So you can quote the command.
The failure mode is particularly arcane, in that you end up
with a message like:
ERROR: Unable to spawn terminal auto: \
Execution of 'pseudo /bin/bash' failed with exit code 1:
usage: new-session [-d] [-n window-name] [-s session-name] \
[-t target-session] [command]
which is confusing because there's no "new-session" anywhere in
sight (that's actually "tmux new"), and because what failed to execute
wasn't either pseudo or bash.
(From OE-Core rev: f8ed7446755eeb88191e16749350efa1e7e6197c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/terminal.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 28470e3e1e..25f8004fab 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py | |||
@@ -122,7 +122,7 @@ class TmuxRunning(Terminal): | |||
122 | 122 | ||
123 | class Tmux(Terminal): | 123 | class Tmux(Terminal): |
124 | """Start a new tmux session and window""" | 124 | """Start a new tmux session and window""" |
125 | command = 'tmux new -d -s devshell -n devshell {command}' | 125 | command = 'tmux new -d -s devshell -n devshell "{command}"' |
126 | priority = 0.75 | 126 | priority = 0.75 |
127 | 127 | ||
128 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 128 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
@@ -133,7 +133,7 @@ class Tmux(Terminal): | |||
133 | # devshells, if it's already there, add a new window to it. | 133 | # devshells, if it's already there, add a new window to it. |
134 | window_name = 'devshell-%i' % os.getpid() | 134 | window_name = 'devshell-%i' % os.getpid() |
135 | 135 | ||
136 | self.command = 'tmux new -d -s {0} -n {0} {{command}}'.format(window_name) | 136 | self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'.format(window_name) |
137 | Terminal.__init__(self, sh_cmd, title, env, d) | 137 | Terminal.__init__(self, sh_cmd, title, env, d) |
138 | 138 | ||
139 | attach_cmd = 'tmux att -t {0}'.format(window_name) | 139 | attach_cmd = 'tmux att -t {0}'.format(window_name) |