diff options
| -rw-r--r-- | meta/lib/oe/terminal.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index afbda595db..e4045559fc 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py | |||
| @@ -39,7 +39,7 @@ class Terminal(Popen, metaclass=Registry): | |||
| 39 | raise | 39 | raise |
| 40 | 40 | ||
| 41 | def format_command(self, sh_cmd, title): | 41 | def format_command(self, sh_cmd, title): |
| 42 | fmt = {'title': title or 'Terminal', 'command': sh_cmd} | 42 | fmt = {'title': title or 'Terminal', 'command': sh_cmd, 'cwd': os.getcwd() } |
| 43 | if isinstance(self.command, str): | 43 | if isinstance(self.command, str): |
| 44 | return shlex.split(self.command.format(**fmt)) | 44 | return shlex.split(self.command.format(**fmt)) |
| 45 | else: | 45 | else: |
| @@ -117,7 +117,7 @@ class Screen(Terminal): | |||
| 117 | class TmuxRunning(Terminal): | 117 | class TmuxRunning(Terminal): |
| 118 | """Open a new pane in the current running tmux window""" | 118 | """Open a new pane in the current running tmux window""" |
| 119 | name = 'tmux-running' | 119 | name = 'tmux-running' |
| 120 | command = 'tmux split-window "{command}"' | 120 | command = 'tmux split-window -c "{cwd}" "{command}"' |
| 121 | priority = 2.75 | 121 | priority = 2.75 |
| 122 | 122 | ||
| 123 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 123 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
| @@ -135,7 +135,7 @@ class TmuxRunning(Terminal): | |||
| 135 | class TmuxNewWindow(Terminal): | 135 | class TmuxNewWindow(Terminal): |
| 136 | """Open a new window in the current running tmux session""" | 136 | """Open a new window in the current running tmux session""" |
| 137 | name = 'tmux-new-window' | 137 | name = 'tmux-new-window' |
| 138 | command = 'tmux new-window -n "{title}" "{command}"' | 138 | command = 'tmux new-window -c "{cwd}" -n "{title}" "{command}"' |
| 139 | priority = 2.70 | 139 | priority = 2.70 |
| 140 | 140 | ||
| 141 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 141 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
| @@ -149,7 +149,7 @@ class TmuxNewWindow(Terminal): | |||
| 149 | 149 | ||
| 150 | class Tmux(Terminal): | 150 | class Tmux(Terminal): |
| 151 | """Start a new tmux session and window""" | 151 | """Start a new tmux session and window""" |
| 152 | command = 'tmux new -d -s devshell -n devshell "{command}"' | 152 | command = 'tmux new -c "{cwd}" -d -s devshell -n devshell "{command}"' |
| 153 | priority = 0.75 | 153 | priority = 0.75 |
| 154 | 154 | ||
| 155 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 155 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
| @@ -160,7 +160,7 @@ class Tmux(Terminal): | |||
| 160 | # devshells, if it's already there, add a new window to it. | 160 | # devshells, if it's already there, add a new window to it. |
| 161 | window_name = 'devshell-%i' % os.getpid() | 161 | window_name = 'devshell-%i' % os.getpid() |
| 162 | 162 | ||
| 163 | self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'.format(window_name) | 163 | self.command = 'tmux new -c "{{cwd}}" -d -s {0} -n {0} "{{command}}"'.format(window_name) |
| 164 | Terminal.__init__(self, sh_cmd, title, env, d) | 164 | Terminal.__init__(self, sh_cmd, title, env, d) |
| 165 | 165 | ||
| 166 | attach_cmd = 'tmux att -t {0}'.format(window_name) | 166 | attach_cmd = 'tmux att -t {0}'.format(window_name) |
