Commit 84c2445
committed
aiorepl: Switch terminal mode around code execution.
Use micropython.stdio_mode_raw() when available to set the terminal to
raw mode for character-at-a-time input and restore cooked mode during
code execution. This matches how the native REPL toggles terminal mode
and fixes aiorepl on the unix port where the terminal defaults to cooked
mode after the native REPL yields control.
On embedded ports where stdio_mode_raw is not available, the getattr
fallback to a no-op lambda keeps the existing behaviour unchanged.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>1 parent a84abd2 commit 84c2445
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| |||
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| 171 | + | |
167 | 172 | | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| |||
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
| 184 | + | |
178 | 185 | | |
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
| 189 | + | |
182 | 190 | | |
183 | 191 | | |
184 | 192 | | |
| |||
264 | 272 | | |
265 | 273 | | |
266 | 274 | | |
| 275 | + | |
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
| |||
0 commit comments