Skip to content

Commit 948e0c9

Browse files
author
a
committed
update
1 parent 3e5ece2 commit 948e0c9

File tree

1 file changed

+72
-57
lines changed

1 file changed

+72
-57
lines changed

README.md

Lines changed: 72 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@ The xonsh developer toolkit contains all spectrum of instrument to develop xonsh
66
If you like the idea click ⭐ on the repo and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/anki-code/xontrib-jump-to-dir" target="_blank">tweet</a>.
77
</p>
88

9-
State: it's stream of notes and drafts now.
9+
## Become xonsh contributor
1010

11-
### The fastest workflow to contribute to xonsh
11+
### Create a xontrib
12+
13+
Create your xontrib step by step from [xontrib-template](https://github.com/xonsh/xontrib-template).
14+
15+
Best xontribs:
16+
* [Xontribs on Github](https://github.com/topics/xontrib)
17+
* [Awesome xontribs](https://github.com/xonsh/awesome-xontribs)
18+
19+
Or choose an [idea](https://github.com/xonsh/xontrib-template/issues?q=is%3Aopen+is%3Aissue+label%3Aidea+sort%3Areactions-%2B1-desc).
20+
21+
### The simplified workflow to contribute to xonsh core
1222

1323
```xsh
1424
mkdir -p ~/git && cd ~/git
@@ -47,7 +57,7 @@ git push
4757
# Create PR: https://github.com/xonsh/xonsh/pulls
4858
```
4959

50-
### IDE
60+
### Setup IDE
5161

5262
#### PyCharm
5363

@@ -78,33 +88,46 @@ The easiest way to start contribute to xonsh core:
7888
5. Create git branch and solve [good first issue](https://github.com/xonsh/xonsh/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+sort%3Areactions-%2B1-desc) or [popular issue](https://github.com/xonsh/xonsh/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
7989
6. Create pull request to xonsh.
8090
81-
## Docs
91+
## Xonsh code
8292
83-
* TTY
84-
* [The TTY demystified](https://www.linusakesson.net/programming/tty/)
85-
* Signals
86-
* [A Deep Dive into the SIGTTIN / SIGTTOU Terminal Access Control Mechanism in Linux](http://curiousthing.org/sigttin-sigttou-deep-dive-linux)
87-
* [Job Control Signals](https://www.gnu.org/software/libc/manual/html_node/Job-Control-Signals.html) and [Access to the Controlling Terminal](https://www.gnu.org/software/libc/manual/html_node/Access-to-the-Terminal.html)
88-
* [man signal - Standard signals](https://man7.org/linux/man-pages/man7/signal.7.html)
89-
* [Process Signal Mask](https://www.gnu.org/software/libc/manual/html_node/Process-Signal-Mask.html)
90-
* [Helpful things for knight: basic docs, tools](https://github.com/xonsh/xonsh/pull/5361#issuecomment-2078826181)
91-
* [SIGINT with multiple threads, each of which has a popen process](https://stackoverflow.com/questions/61854884/c-sigint-handler-not-working-with-multiple-threads-each-of-which-has-a-popen)
92-
* Python threads
93-
* [Python: signals and threads](https://docs.python.org/3/library/signal.html#signals-and-threads): "Python signal handlers are always executed in the main Python thread of the main interpreter, even if the signal was received in another thread"
94-
* [In Python, what are the cons of calling os.waitpid in a program with multiple threads?](https://stackoverflow.com/questions/5691309/in-python-what-are-the-cons-of-calling-os-waitpid-in-a-program-with-multiple-th)
95-
* Misc
96-
* [fzf source code: Render UI directly to /dev/tty](https://github.com/junegunn/fzf/commit/d274d093afa667a6ac5ee34579807de195ade784)
97-
* Research
98-
* [Stackoverflow questions around subprocess Popen and PIPE](https://stackoverflow.com/search?tab=newest&q=code%3a%22popen%22%20code%3a%22subprocess%22%20code%3a%22PIPE%22%20answers%3a1&searchOn=3)
99-
* [Github code around subprocess Popen and PIPE](https://github.com/search?q=Popen+PIPE+language%3APython&type=code&l=Python)
100-
* Processes
101-
* [The Unix process API is unreliable and unsafe](https://catern.com/process.html)
102-
103-
## Pointers
93+
### Pointers
10494
10595
* The main loop for interactive prompt: `main.py` -> `shell.shell.cmdloop()`.
10696
* The main function to run subprocess: `procs/specs.py` -> `run_subproc`.
10797
98+
## Pure environment
99+
100+
### Test in pure Linux environment
101+
```xsh
102+
docker run --rm -it xonsh/xonsh:slim bash -c "pip install -U 'xonsh[full]' && xonsh"
103+
# a1b2c3 # docker container id
104+
apt update && apt install -y vim git procps strace # to run `ps`
105+
```
106+
```xsh
107+
# Connect to container from other terminal:
108+
docker exec -it a1b2c3 bash
109+
```
110+
```xsh
111+
# Save docker container state to reuse:
112+
docker ps
113+
docker commit c3f279d17e0a local/my_xonsh # the same for update
114+
docker run --rm -it local/my_xonsh xonsh
115+
```
116+
Trace signals with `strace`:
117+
```xsh
118+
python -c 'input()' &
119+
# pid 123
120+
strace -p 123
121+
# strace: Process 123 attached
122+
# [ Process PID=123 runs in x32 mode. ]
123+
# --- stopped by SIGTTIN ---
124+
kill -SIGCONT 72 # From another terminal.
125+
# --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=48, si_uid=0} ---
126+
# syscall_0x7ffffff90558(0x5555555c5a00, 0, 0x7fffff634940, 0, 0, 0x3f) = 0x2
127+
# --- SIGTTIN {si_signo=SIGTTIN, si_code=SI_KERNEL} ---
128+
# --- stopped by SIGTTIN ---
129+
```
130+
108131
## Capturing: stdout, stderr, tty
109132

110133
### Test capturing aliases
@@ -139,40 +162,32 @@ ps fzf | grep fzf
139162
# etc etc etc
140163
```
141164

142-
## Pure environment
165+
## Process and subprocess
143166

144-
### Test in pure Linux environment
145-
```xsh
146-
docker run --rm -it xonsh/xonsh:slim bash -c "pip install -U 'xonsh[full]' && xonsh"
147-
# a1b2c3 # docker container id
148-
apt update && apt install -y vim git procps strace # to run `ps`
149-
```
150-
```xsh
151-
# Connect to container from other terminal:
152-
docker exec -it a1b2c3 bash
153-
```
154-
```xsh
155-
# Save docker container state to reuse:
156-
docker ps
157-
docker commit c3f279d17e0a local/my_xonsh # the same for update
158-
docker run --rm -it local/my_xonsh xonsh
159-
```
160-
Trace signals with `strace`:
161-
```xsh
162-
python -c 'input()' &
163-
# pid 123
164-
strace -p 123
165-
# strace: Process 123 attached
166-
# [ Process PID=123 runs in x32 mode. ]
167-
# --- stopped by SIGTTIN ---
168-
kill -SIGCONT 72 # From another terminal.
169-
# --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=48, si_uid=0} ---
170-
# syscall_0x7ffffff90558(0x5555555c5a00, 0, 0x7fffff634940, 0, 0, 0x3f) = 0x2
171-
# --- SIGTTIN {si_signo=SIGTTIN, si_code=SI_KERNEL} ---
172-
# --- stopped by SIGTTIN ---
173-
```
167+
### Docs
168+
169+
## Docs
170+
171+
* TTY
172+
* [The TTY demystified](https://www.linusakesson.net/programming/tty/)
173+
* Signals
174+
* [A Deep Dive into the SIGTTIN / SIGTTOU Terminal Access Control Mechanism in Linux](http://curiousthing.org/sigttin-sigttou-deep-dive-linux)
175+
* [Job Control Signals](https://www.gnu.org/software/libc/manual/html_node/Job-Control-Signals.html) and [Access to the Controlling Terminal](https://www.gnu.org/software/libc/manual/html_node/Access-to-the-Terminal.html)
176+
* [man signal - Standard signals](https://man7.org/linux/man-pages/man7/signal.7.html)
177+
* [Process Signal Mask](https://www.gnu.org/software/libc/manual/html_node/Process-Signal-Mask.html)
178+
* [Helpful things for knight: basic docs, tools](https://github.com/xonsh/xonsh/pull/5361#issuecomment-2078826181)
179+
* [SIGINT with multiple threads, each of which has a popen process](https://stackoverflow.com/questions/61854884/c-sigint-handler-not-working-with-multiple-threads-each-of-which-has-a-popen)
180+
* Python threads
181+
* [Python: signals and threads](https://docs.python.org/3/library/signal.html#signals-and-threads): "Python signal handlers are always executed in the main Python thread of the main interpreter, even if the signal was received in another thread"
182+
* [In Python, what are the cons of calling os.waitpid in a program with multiple threads?](https://stackoverflow.com/questions/5691309/in-python-what-are-the-cons-of-calling-os-waitpid-in-a-program-with-multiple-th)
183+
* Misc
184+
* [fzf source code: Render UI directly to /dev/tty](https://github.com/junegunn/fzf/commit/d274d093afa667a6ac5ee34579807de195ade784)
185+
* Research
186+
* [Stackoverflow questions around subprocess Popen and PIPE](https://stackoverflow.com/search?tab=newest&q=code%3a%22popen%22%20code%3a%22subprocess%22%20code%3a%22PIPE%22%20answers%3a1&searchOn=3)
187+
* [Github code around subprocess Popen and PIPE](https://github.com/search?q=Popen+PIPE+language%3APython&type=code&l=Python)
188+
* Processes
189+
* [The Unix process API is unreliable and unsafe](https://catern.com/process.html)
174190

175-
## Process and subprocess
176191

177192
### Tools for modeling the process behavior
178193

0 commit comments

Comments
 (0)