Open chipbuster opened 2 years ago
Hey @chipbuster -- thanks for reporting! I have to dig in a bit more, but the root cause of this is that the coreutils
implementation of cat
is doing something a bit fishy with our process runner.
There are two workarounds:
coreutils
(especially since it seems like you're on linux or OSX and should have those utils available already)cat
if you do load coreutils
-- that is, ignore the cat
alias that gets created by coreutils
and directly call the cat
binary, e.g. in your example:def prompt():
return $(sleep 0.5 | echo """Prompt>""" | /usr/bin/cat)
- Don't load
coreutils
I tried this workaround and it works well on all of my *nix machine, including native Debian, Debian on WSL2 and OSX. Thanks a lot for that! 😄
Had a similar issue trying to pin down why execx($(starship init xonsh))
would crash the shell on OSX!
Another issue I had was that the fallback /bin/bash
process would take a lot of CPU% even after I close the terminal. Any idea how to remove this fallback behavior?
As a workaround, this seems to work (add it after loading coreutils)
del aliases['cat'] # workaround for this bug https://github.com/xonsh/xontrib-coreutils/issues/1
xonfig
Expected Behavior
The shell doesn't crash.
Current Behavior
When running a sufficiently slow external command as
PROMPT
in xonsh, one of two things can happen:Failed to format prompt <something> -> <class 'TypeError'>:'NoneType' object cannot be interpreted as an integer
In the output below, I was mashing ENTER at a blank prompt, and the exception occurred after 3 attempts.
The issue completely disappears if
xontrib load coreutils
is commented.Traceback (if applicable)
Steps to Reproduce
I believe that simply using the config above, launching xonsh, and mashing ENTER at a blank prompt should trigger the bug. However, both systems tested with this bug seem to be using Python 3.10. I attempted to test this with Python 3.8 and I think I got a reproduction, but I'm not 100% certain I did it correctly (I'm not terribly familiar with python environments), so let me know if this fails to reproduce.
For community
⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 comment