mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00

* feat: add function to make event registration from function signature * docs: add xontrib special functions description * feat: handle xontribs with special functions also reduce usage of XSH singleton * fix: missing XSH for now import singleton * docs: fix .rst format * fix: failing tests * feat: implement primitive xontrib-unload and xontrib-reload * chore: give explicit name * docs: update doc
15 lines
391 B
Python
15 lines
391 B
Python
"""Simple built-in debugger. Runs pdb on reception of SIGUSR1 signal."""
|
|
import signal
|
|
|
|
from xonsh.built_ins import XonshSession
|
|
|
|
|
|
def handle_sigusr1(sig, frame):
|
|
print("\nSIGUSR1 signal received. Starting interactive debugger...", flush=True)
|
|
import pdb
|
|
|
|
pdb.Pdb().set_trace(frame)
|
|
|
|
|
|
def _load_xontrib_(xsh: XonshSession, **_):
|
|
signal.signal(signal.SIGUSR1, handle_sigusr1)
|