This branch includes detailed logging to diagnose Windows-specific issues with PTY output and mobile display.
Windows (PowerShell):
$env:DEBUG="1"
termly-dev start --debugWindows (CMD):
set DEBUG=1
termly-dev start --debugMac/Linux:
DEBUG=1 termly-dev start --debugWindows:
# View entire log
Get-Content $env:USERPROFILE\.termly\logs\cli.log
# Follow log in real-time
Get-Content $env:USERPROFILE\.termly\logs\cli.log -Wait -Tail 50
# Open in Notepad
notepad $env:USERPROFILE\.termly\logs\cli.logMac/Linux:
# View entire log
cat ~/.termly/logs/cli.log
# Follow log in real-time
tail -f ~/.termly/logs/cli.log[DEBUG] WS Input received (5 bytes):
[DEBUG] Text: hello
[DEBUG] Hex: 68 65 6c 6c 6f
[DEBUG] PTY Input (5 bytes):
[DEBUG] Text: hello
[DEBUG] Hex: 68 65 6c 6c 6f
[DEBUG] PTY Raw Output (14 bytes):
[DEBUG] Text: Hello World\r\n
[DEBUG] Hex: 48 65 6c 6c 6f 20 57 6f 72 6c 64 0d 0a
[DEBUG] WS Output sending (14 bytes):
[DEBUG] Text: Hello World\r\n
[DEBUG] Hex: 48 65 6c 6c 6f 20 57 6f 72 6c 64 0d 0a
- Windows:
\r\n(hex:0d 0a) - Mac/Linux:
\n(hex:0a)
If Windows logs show \r\n but Mac shows only \n, this explains rendering differences.
Compare PTY output with WS output:
- If they're identical → problem is in mobile app rendering
- If WS output has duplicates → problem is in CLI logic
Look for \x1b[... patterns (ANSI escape codes):
- Different codes between Windows/Mac → different terminal behavior
- Extra codes → cmd.exe adding formatting
If you see the same input twice:
- Once as "PTY Input" (what you typed)
- Again as "PTY Output" (echo from cmd.exe)
This means cmd.exe is echoing input back.
- Run:
termly-dev start --debug - Type a few characters on mobile
- Copy log:
Get-Content $env:USERPROFILE\.termly\logs\cli.log | Set-Clipboard - Paste into file:
windows-log.txt
- Run:
termly-dev start --debug - Type the same characters on mobile
- Copy log:
cat ~/.termly/logs/cli.log | pbcopy - Paste into file:
mac-log.txt
diff windows-log.txt mac-log.txtLook for differences in:
- Hex values
- Line endings (
\r\nvs\n) - Escape sequences
- Duplicate data
- Line endings:
\r\n(Windows) vs\n(Unix) - Terminal type codes
- Path separators
- Duplicate characters
- Extra escape sequences causing artifacts
- Different data being sent to mobile