Comments (17)
Is there a way to repeat this?
from xonsh.
I am not sure what changed for the crash to appear.
The crashing version is
➤ xonsh.version
'0.14.2'
from xonsh.
Does it happen consistently for you though?
from xonsh.
It happens often enough so that I had to switch my shell back to fish. But not reproducible, I don't know what exactly triggers the crash.
from xonsh.
Please add the xonfig
command output.
from xonsh.
➤ xonfig
+------------------+---------------------+
| xonsh | 0.14.2 |
| Python | 3.12.0 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 3.0.41 |
| shell type | prompt_toolkit |
| history backend | json |
| pygments | 2.17.2 |
| on posix | True |
| on linux | False |
| on darwin | True |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
| xontrib | [] |
| RC file 1 | /Users/cls/.xonshrc |
+------------------+---------------------+
from xonsh.
I have also started getting this error after a recent update (installed via homebrew on an m1 macbook). In my case it's not the ctrl+c interrupt that seems to be the problem, but just now and then running a command (most recently git diff HEAD
and even ls ~/Library/Logs/Homebrew
) will just hang for 10 seconds before I cancel it with ctrl+c (though it will hang for hours if left alone). Then I'll get a similar stack trace like @clstaudt and then I'll restart xonsh.
Mostly this happened to me within tmux, but I was also able to reproduce it in a new Terminal.app window without tmux.
from xonsh.
Hi @mltucker! I'm also mac m1 user and xonsh installed from conda and everything is perfect for me. Could you please alsoo paste the xonfig
output.
from xonsh.
+------------------+-------------------+
| xonsh | 0.14.3 |
| Python | 3.12.1 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 3.0.41 |
| shell type | prompt_toolkit |
| history backend | json |
| pygments | 2.17.2 |
| on posix | True |
| on linux | False |
| on darwin | True |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
| xontrib | [] |
| RC file 1 | /Users/m/.xonshrc |
+------------------+-------------------+
I use zoxide but otherwise my xonshrc is barebones.
from xonsh.
Thanks @mltucker ! I'm using py 3.11 but you and the reporter are on 3.12. Maybe this is an upstream issue around prompt-toolkit and asyncio
on 3.12. It will be cool to have a try to repeat this issue on 3.11 to confirm this.
from xonsh.
@anki-code it's very strange because my python --version
gives me 3.11.7 and brew edit xonsh
says it depends on [email protected]. I see that I have both 3.11 and 3.12 installed. I can't uninstall [email protected] since "it is required by llvm and xonsh, which are currently installed". Is there a way I can tell xonsh which python to use?
from xonsh.
@mltucker please read the section about xonsh and package managers to understand how it works. Read as much as possible examples after this section.
from xonsh.
@anki-code thanks! I've uninstalled xonsh from homebrew and instead now run it from conda3. I believe I'm seeing the same issue, though now it looks a bit different. Sometimes commands (most recently git add -p
) will just hang. Ctrl+C closes the tmux window instead of quitting the process and showing the error message that @clstaudt reported above (which I used to also see). I will report back.
from xonsh.
@anki-code OK, I reproduced it again and this time recorded my screen. Just for a frame or two the error message popped up. Here's a screenshot:
Possibly the reason the message briefly flashed and closed my terminal window is that instead of fixing my path issues, I made a script /usr/local/bin/xonsh with:
#!/bin/bash
/opt/miniconda3/bin/xonsh $@
Here's my xonfig, this time with python 3.11:
+------------------+-------------------+
| xonsh | 0.14.4 |
| Python | 3.11.7 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 3.0.42 |
| shell type | prompt_toolkit |
| history backend | json |
| pygments | 2.17.2 |
| on posix | True |
| on linux | False |
| on darwin | True |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
| xontrib | [] |
| RC file 1 | /Users/m/.xonshrc |
+------------------+-------------------+
from xonsh.
Weird error with asyncio.
I made a script /usr/local/bin/xonsh
It's not needed if you're doing right. Basically if you want to just have a shell you can install xonsh from brew's python via pip and have it in PATH:
# zsh
cat ~/.zshrc | grep brew
# eval "$(/opt/homebrew/bin/brew shellenv)"
which xonsh
# /opt/homebrew/bin/xonsh
which python
# /opt/homebrew/bin/python
python -V
# Python 3.11.6
xonsh
[p for p in $PATH if 'brew/bin' in p]
# ['/opt/homebrew/bin']
This allows to run xonsh from zsh.
from xonsh.
OR if you're using conda:
conda activate base
[p for p in $PATH if 'conda' in p]
# /Users/user/miniconda3/bin
wooooooooooow
during I prepared the example to you I found that after conda activate base
the Ctrl+C command hangs the terminal.
It's soooooo weird :)
Yeah, I can repeat this with this stack:
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/xonsh/procs/posix.py", line 310, in _signal_int
signal.pthread_kill(threading.get_ident(), signal.SIGINT)
File "/opt/homebrew/lib/python3.11/site-packages/xonsh/procs/posix.py", line 310, in _signal_int
signal.pthread_kill(threading.get_ident(), signal.SIGINT)
File "/opt/homebrew/lib/python3.11/site-packages/xonsh/procs/posix.py", line 310, in _signal_int
signal.pthread_kill(threading.get_ident(), signal.SIGINT)
[Previous line repeated 994 more times]
File "/opt/homebrew/lib/python3.11/site-packages/xonsh/procs/posix.py", line 309, in _signal_int
if xt.on_main_thread() and not xp.ON_WINDOWS:
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/xonsh/tools.py", line 1234, in on_main_thread
return threading.current_thread() is threading.main_thread()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1461, in current_thread
return _active[get_ident()]
^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object
I can't repeat this on xonsh --no-rc
from xonsh.
I found that issue appeared starting from prompt-toolkit 3.0.41 where asyncio
was introduced (prompt-toolkit/python-prompt-toolkit@8c60193).
To fix this just downgrade the prompt-toolkit version:
xpip uninstall -y prompt-toolkit
xpip install prompt-toolkit==3.0.40
The issue was reported to upstream - prompt-toolkit/python-prompt-toolkit#1853
from xonsh.
Related Issues (20)
- Refactoring: soft split xonsh into components
- Refactoring: commands cache HOT 5
- Xonsh immediately crashes when started, ujson attribute error HOT 2
- Reduce loading colors in non interactive command
- Refactoring: split `tools.py` into libs
- INVERT_ prompt color prefix does nothing HOT 2
- {user} in $PROMPT inaccurate if the user is root HOT 1
- $SHELL wrongly set; messes with tmux HOT 4
- Test failure building for NixOS HOT 6
- Refactoring: xontribs HOT 3
- No good way to get the last return code in a script HOT 2
- Implement `exit N` HOT 3
- current main: callable alias completion `Exception sequence item 0: expected str instance, FuncAlias found`
- Sometimes I see lag in first xonsh (or any python app?) run in new ssh session HOT 3
- Edge case: Shadowing xonsh in case of running script with shebang in virtual env
- Wrong path resolution in subprocess HOT 5
- Run tests: `fixture 'xession' not found use 'pytest --fixtures [testpath]' for help on them.` HOT 1
- conda and mamba: `DeprecationWarning: Use xonsh.lib.lazyasd instead of xonsh.lazyasd.` HOT 1
- What is changed after releasing new resolver? HOT 2
- Windows: Comapre typing speed: xonsh 0.16.0 vs 0.18.2 HOT 29
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xonsh.