Closed autrilla closed 7 years ago
Please can you try modifying the exec-path-from-shell--standard-shell-p function so that it returns non-nil for xonsh, and tell me if that works for you?
Unfortunately it does not. I don't know anything about emacs's escape sequences, so I'm not sure what exactly is being passed to xonsh.
Warning (initialization): An error occurred while loading ‘/Users/autrilla/.emacs.d/init.el’:
error: Non-zero exit code from shell /usr/local/bin/xonsh invoked with args ("-l" "-i" "-c" "sh -c /usr/bin/printf\\ \\'__RESULT\\\\000\\%s\\\\000\\%s\\'\\ \\\"\\$\\{PATH-cf27d4b8e449cf22670ae455a8cb7c00\\}\\\"\\ \\\"\\$\\{MANPATH-cf27d4b8e449cf22670ae455a8cb7c00\\}\\\""). Output was:
"Traceback (most recent call last):
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 16978, in _parse_ctx_free
debug_level=(self.debug_level > 1))
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/parsers/base.py\", line 324, in parse
tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/ply/yacc.py\", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/ply/yacc.py\", line 1181, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/ply/yacc.py\", line 193, in call_errorfunc
r = errorfunc(token)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/parsers/base.py\", line 2582, in p_error
column=p.lexpos))
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/parsers/base.py\", line 450, in _parse_error
raise err
SyntaxError: e3694a1112a05d42f84eb4b27db5f897:1:60: ('code: {',)
![sh -c /usr/bin/printf\\ \\'__RESULT\\\\000\\%s\\\\000\\%s\\'\\ \\\"\\$\\{PATH-cf27d4b8e449cf22670ae455a8cb7c00\\}\\\"\\ \\\"\\$\\{MANPATH-cf27d4b8e449cf22670ae455a8cb7c00\\}\\\"]
^
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/usr/local/bin/xonsh\", line 3, in <module>
main()
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 17488, in main
run_code_with_cache(args.command.lstrip(), shell.execer, mode='single')
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 2084, in run_code_with_cache
ccode = compile_code(filename, code, execer, glb, loc, mode)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 2000, in compile_code
ccode = execer.compile(code, glbs=glb, locs=loc, mode=mode)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 16917, in compile
transform=transform)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 16887, in parse
tree, input = self._parse_ctx_free(input, mode=mode, filename=filename)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 17036, in _parse_ctx_free
raise original_error
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/__amalgam__.py\", line 16978, in _parse_ctx_free
debug_level=(self.debug_level > 1))
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/parsers/base.py\", line 324, in parse
tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/ply/yacc.py\", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/ply/yacc.py\", line 1181, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/ply/yacc.py\", line 193, in call_errorfunc
r = errorfunc(token)
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/parsers/base.py\", line 2577, in p_error
column=p.lexpos))
File \"/usr/local/Cellar/xonsh/0.4.6/libexec/lib/python3.5/site-packages/xonsh/parsers/base.py\", line 450, in _parse_error
raise err
SyntaxError: e3694a1112a05d42f84eb4b27db5f897:1:21: \\
sh -c /usr/bin/printf\\ \\'__RESULT\\\\000\\%s\\\\000\\%s\\'\\ \\\"\\$\\{PATH-cf27d4b8e449cf22670ae455a8cb7c00\\}\\\"\\ \\\"\\$\\{MANPATH-cf27d4b8e449cf22670ae455a8cb7c00\\}\\\"
^
"
Hmmm... The approach taken by exec-path-from-shell
works for other non-POSIX shells such as fish
, so my feeling is that this will likely require an upstream fix in xonsh
's parser. I won't be investigating this problem further myself, sorry, but if it turns out there's a very simple workaround we can add to exec-path-from-shell
, then I'd welcome a pull request.
When running exec-path-from-shell from macOS Sierra and xonsh as my default shell, I get the following error: