Commit c54b390
authored
fix: parse escape sequences in pty_write input (#4)
The pty_write tool was receiving escape sequences like \x03 as literal
strings instead of converting them to actual bytes. This meant sending
Ctrl+C (\x03) would write the 4 characters '\x03' instead of the
interrupt signal byte.
Added parseEscapeSequences() function that converts:
- \xNN to hex bytes (e.g., \x03 → Ctrl+C)
- \uNNNN to unicode characters
- \n, \r, \t to their respective control characters
- \\\\ to literal backslash
This fixes the documented behavior in write.txt which promises escape
sequence support.1 parent 98d457a commit c54b390
1 file changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
6 | 28 | | |
7 | 29 | | |
8 | 30 | | |
| |||
38 | 60 | | |
39 | 61 | | |
40 | 62 | | |
41 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
42 | 67 | | |
43 | 68 | | |
44 | 69 | | |
45 | 70 | | |
46 | 71 | | |
47 | 72 | | |
48 | 73 | | |
49 | | - | |
| 74 | + | |
50 | 75 | | |
51 | 76 | | |
52 | 77 | | |
| |||
0 commit comments