Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
anki-code authored Jun 8, 2024
1 parent 03009b2 commit afbc3e8
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Create your xontrib step by step from [xontrib-template](https://github.com/xons
* History backends are in `xonsh/history/`.
* Environment variables are in `xonsh/environ.py`.
## Pure environment
## xonsh in docker
### Test in pure Linux environment
```xsh
Expand All @@ -112,19 +112,12 @@ docker ps
docker commit c3f279d17e0a local/my_xonsh # the same for update
docker run --rm -it local/my_xonsh xonsh
```
Trace signals with `strace`:


### Test old versions of xonsh
```xsh
python -c 'input()' &
# pid 123
strace -p 123
# strace: Process 123 attached
# [ Process PID=123 runs in x32 mode. ]
# --- stopped by SIGTTIN ---
kill -SIGCONT 72 # From another terminal.
# --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=48, si_uid=0} ---
# syscall_0x7ffffff90558(0x5555555c5a00, 0, 0x7fffff634940, 0, 0, 0x3f) = 0x2
# --- SIGTTIN {si_signo=SIGTTIN, si_code=SI_KERNEL} ---
# --- stopped by SIGTTIN ---
docker run --rm -it python:3.6-slim-bullseye bash -c "pip install xonsh==0.5.0 && bash"
xonsh
```

## Capturing: stdout, stderr, tty
Expand Down Expand Up @@ -268,6 +261,23 @@ ps ax | grep fzf # pid=123
# SigCgt SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGTRAP,SIGABRT,SIGBUS,SIGFPE,SIGUSR1,SIGSEGV,SIGUSR2,SIGPIPE,SIGALRM,SIGTERM,SIGSTKFLT
```

### Trace signals with `strace`
```xsh
docker run --rm -it xonsh/xonsh:slim bash -c "pip install -U 'xonsh[full]' && xonsh"
apt update && apt install -y vim git procps strace
python -c 'input()' &
# pid 123
strace -p 123
# strace: Process 123 attached
# [ Process PID=123 runs in x32 mode. ]
# --- stopped by SIGTTIN ---
kill -SIGCONT 72 # From another terminal.
# --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=48, si_uid=0} ---
# syscall_0x7ffffff90558(0x5555555c5a00, 0, 0x7fffff634940, 0, 0, 0x3f) = 0x2
# --- SIGTTIN {si_signo=SIGTTIN, si_code=SI_KERNEL} ---
# --- stopped by SIGTTIN ---
```

## Testing

### Test xonsh script with Github Actions
Expand Down

0 comments on commit afbc3e8

Please sign in to comment.