Skip to content

Commit

Permalink
Merge pull request #123 from blink1073/fix-shell-windows
Browse files Browse the repository at this point in the history
Fix shell magic on Windows
  • Loading branch information
blink1073 committed Jan 14, 2017
2 parents fa07b27 + 5d7ff87 commit 61bf24f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions metakernel/magics/shell_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def line_shell(self, *args):
"""
# get in sync with the cwd
self.eval('cd %s' % os.getcwd())
self.eval('cd %s' % os.getcwd().replace(os.path.sep, '/'))

command = " ".join(args)
self.eval(command, True)

if self.cmd == 'cmd':
cwd = self.eval('cd')
cwd = self.eval('echo %cd%')
else:
cwd = self.eval('pwd')

Expand Down
4 changes: 2 additions & 2 deletions metakernel/replwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ def run_command(self, command, timeout=None, stream_handler=None,
res = []
self._stream_handler = stream_handler
self._stdin_handler = stdin_handler
self.child.sendline(cmdlines[0])
self.sendline(cmdlines[0])
for line in cmdlines[1:]:
self._expect_prompt(timeout=timeout)
res.append(self.child.before)
self.child.sendline(line)
self.sendline(line)

# Command was fully submitted, now wait for the next prompt
if self._expect_prompt(timeout=timeout) == 1:
Expand Down

0 comments on commit 61bf24f

Please sign in to comment.