美文网首页
windows上autojump的安装之后无法使用的解决方法

windows上autojump的安装之后无法使用的解决方法

作者: CodeBetter | 来源:发表于2019-07-19 16:32 被阅读0次

    原来在mac上使用完全没啥问题,换成windows后总是报错,网上资料也比较少,最后还是在github的issue里找到的解决办法。

    现在总结下:

    安装之后autojump --help都能出来提示消息

    问题出在一旦 j xx时就报如下错误

    ```

    Traceback (most recent call last):

      File "C:\Program Files (x86)\CowShell\Vendor\AutoJump\bin\\autojump", line 320, in <module>

        sys.exit(main(parse_arguments()))

      File "C:\Program Files (x86)\CowShell\Vendor\AutoJump\bin\\autojump", line 314, in main

        ['.'])))

      File "C:\Program Files (x86)\CowShell\Vendor\AutoJump\bin\autojump_utils.py", line 42, in first

        return it.next()

      File "C:\Program Files (x86)\CowShell\Vendor\AutoJump\bin\autojump_match.py", line 86, in <lambda>

        flags=regex_flags,

      File "F:\Programs\Python\lib\re.py", line 146, in search

        return _compile(pattern, flags).search(string)

      File "F:\Programs\Python\lib\re.py", line 251, in _compile

        raise error, v # invalid expression

    sre_constants.error: unexpected end of regular expression

    ```

    解决办法如下:

    然后将你 python ./install.py 生成的文件路径bin目录下的autojump_match.py文件中

    ```

    regex_no_sep = '[^' + os.sep + ']*'

    regex_no_sep_end = regex_no_sep + '$'

    regex_one_sep = regex_no_sep + os.sep + regex_no_sep

    替换成下面这段即可解决

    sep = os.sep if os.sep != '\\' else '\\\\'

    regex_no_sep = '[^' + sep + ']*'

    regex_no_sep_end = regex_no_sep + '$'

    regex_one_sep = regex_no_sep + sep + regex_no_sep

    ```

    相关文章

      网友评论

          本文标题:windows上autojump的安装之后无法使用的解决方法

          本文链接:https://www.haomeiwen.com/subject/ewsslctx.html