Repository navigation
Commit 1226e41
Document that the REPL client reads piped stdin
The docs described only the interactive session. The client also runs each piped
line in the session namespace, which is what lets a shell script drive a live app
with nobody at the keyboard — reaching a state that would otherwise have to be
clicked to, in a GUI app or anything else with a slow way in.
With the trap that makes an automated check necessary, because it is invisible
until it has already cost something: the session echoes the value of an
expression and a statement has none, so a pipe made only of assignments prints
nothing and is indistinguishable from one that never ran. Same banner, same
prompts, same `Session closed.` A `print` shows up because `print` writes to
stdout itself, which is what makes it usable as the check — and the demo app that
`unpythonic.net.server` already runs as `__main__` is the throwaway host to try a
pipe against beforehand.
Found while driving a GUI app in another project through this client, where the
first check piped an assignment and needed a purpose-built host to read the value
back — work the demo app makes unnecessary.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hh7cgbLE8wSHudFVgTSzpi1 parent 5208d45 commit 1226e41
3 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
| |||
0 commit comments