xonsh
xonsh copied to clipboard
xontribs hang on piping output to grep, ag
xonfig
+------------------+----------------------+
| xonsh | 0.7.2 |
| Git SHA | d9651fe8 |
| Commit Date | Jul 30 10:58:07 2018 |
| Python | 3.6.6 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 1.0.15 |
| shell type | prompt_toolkit1 |
| pygments | 2.2.0 |
| on posix | True |
| on linux | True |
| distro | Ubuntu |
| on darwin | False |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
+------------------+----------------------+
Expected Behavior
$ xontrib list | grep loaded
should produce an output of loaded xontribs.
Current Behavior
xonsh hungs
Steps to Reproduce
$ xonsh
$ xontrib list | grep loaded
For community
⬇️ Please click the 👍 reaction instead of leaving a +1
or 👍 comment
Thanks for opening this. I think the issue is that xontrib
is unthreadable (for loading), and its output is being written before grep starts up. This is probably a general problem for all unthreadable callable aliases.
@scopatz Hey, and could you please point me to the code where I can make it threadable, just to check that assumption? Thanks
Sorry for the super slow reply @alex-bender - but I believe that it is this line: https://github.com/xonsh/xonsh/blob/master/xonsh/xontribs.py#L167
It's ok! Glad that you found one.
I can reproduce this by running xontrib list | grep loaded
.
Closed with the reference to https://github.com/xonsh/xonsh/issues/5317#issuecomment-2032017790