1
0
mirror of https://github.com/wting/autojump synced 2025-06-13 12:54:07 +00:00
This commit is contained in:
Keith Hughitt 2013-06-05 06:28:36 -07:00
commit 6e02d9827a

View File

@ -8,7 +8,7 @@ To install, `create a new IPython user profile <http://ipython.org/ipython-doc/s
if you have not already done so by running: if you have not already done so by running:
ipython profile create ipython profile create
And copy this file into the "startup" folder of your new profile (e.g. And copy this file into the "startup" folder of your new profile (e.g.
"$HOME/.config/ipython/profile_default/startup/"). "$HOME/.config/ipython/profile_default/startup/").
@ -24,9 +24,9 @@ ip = get_ipython()
@register_line_magic @register_line_magic
def j(path): def j(path):
cmd = ['autojump'] + path.split() cmd = ['autojump'] + path.split()
newpath = sub.Popen(cmd, stdout=sub.PIPE, shell=False).communicate()[0][:-1] # delete last '\n' newpath = sub.Popen(cmd, stdout=sub.PIPE, shell=False).communicate()[0].strip()
if newpath: if newpath:
ip.magic('cd %s' % newpath) ip.magic('cd %s' % newpath.decode('utf-8'))
# remove from namespace # remove from namespace
del j del j