ProcessOutput() in the readLoop was processing every byte of SSH output,
looking for OSC 7 sequences. When these sequences split across read
boundaries (common with 32KB buffer), partial sequences leaked through
and corrupted xterm.js parser state — producing red/green color blocks
instead of text, and characters rendering at wrong widths.
Reverted readLoop to direct passthrough (v0.7.3 behavior). Also removed
shell integration injection (stty -echo + PROMPT_COMMAND) which caused
terminal mode disruption on macOS. Also removed 4px xterm padding that
could cause fitAddon cell width miscalculation.
CWD tracking will be re-implemented via a separate SSH exec channel
that polls pwd without touching the terminal data stream.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two missing halves of CWD tracking:
1. Frontend: useSftp now listens for ssh:cwd:{sessionId} Wails events
and calls navigateTo() when followTerminal is enabled (default: on).
2. Backend: re-added shell integration injection with stty -echo to
suppress visible command output. Leading space keeps it out of
shell history. Handles both bash (PROMPT_COMMAND) and zsh (precmd).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CWD tracking PROMPT_COMMAND/precmd injection wrote raw escape
sequences to stdin that echoed back to the user. Removed until we
have a non-echoing mechanism (e.g., second SSH channel or .bashrc
modification). CWD tracking still works passively for shells that
already emit OSC 7 sequences.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
U-1: Replace ssh.InsecureIgnoreHostKey() with TOFU (Trust On First Use) host
key verification via HostKeyStore. New keys auto-store, matching keys accept
silently, CHANGED keys reject with MITM warning. Added DeleteHostKey() for
legitimate re-key scenarios.
U-2: Wire CWDTracker per SSH session. readLoop() now processes OSC 7 escape
sequences, strips them from terminal output, and emits ssh:cwd:{sessionID}
Wails events on directory changes. Shell integration commands (bash/zsh
PROMPT_COMMAND) injected after connection.
U-3: Session manager now tracks all SSH and RDP sessions via CreateWithID()
which accepts the service-level UUID instead of generating a new one.
ConnectSSH, ConnectSSHWithPassword, ConnectRDP register sessions;
DisconnectSession and RDPDisconnect remove them. ConnectedAt timestamp set.
U-4: WorkspaceService instantiated in New(), clean shutdown flag managed on
startup/exit, workspace state auto-saved on every session open/close.
Frontend-facing proxy methods exposed: SaveWorkspace, LoadWorkspace,
MarkCleanShutdown, WasCleanShutdown, GetSessionCWD.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three fixes:
1. Streaming TextDecoder: a single TextDecoder instance with {stream: true}
persists across events. Split multi-byte UTF-8 sequences at Go read()
boundaries are now buffered and decoded correctly across chunks.
2. requestAnimationFrame batching: incoming SSH data is accumulated and
flushed to xterm.js once per frame instead of on every Wails event.
Eliminates the laggy typewriter effect when output arrives in small
chunks (which is normal for SSH PTY output).
3. PTY baud rate: bumped TTY_OP_ISPEED/OSPEED from 14400 (modem speed)
to 115200. Some remote PTYs throttle output to match the declared rate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>