35 Commits
Author SHA1 Message Date
zhanglq e17b92cd9d fix: prevent Mosh character ghosting caused by overlapping diffs
- client.go: track last output oldNum, replace instead of append when same base
- transport.go: reject diffs that do not chain from latest acknowledged state
  (oldNum != ackNum), preventing stale ANSI sequences from corrupting output
2026-07-02 21:01:24 +08:00
realrasengan 8dca5c67ec add video caption 2026-04-05 15:06:48 -07:00
realrasengan 94dd5a8b52 add demo thumbnail, fix dependencies list 2026-04-05 15:05:28 -07:00
realrasengan 31b4ffccfc cap state map to 16 entries to prevent OOM in WASM 2026-04-02 23:40:59 -07:00
realrasengan d9db3986ba reuse zlib writer to fix OOM in WASM 2026-04-02 21:29:51 -07:00
realrasengan 8e597f7e5d fix prediction: confirm space characters instead of stalling 2026-04-01 18:22:18 -07:00
realrasengan f058c421e7 WASM: support WebTransport reconnection with session token 2026-04-01 16:54:13 -07:00
realrasengan 4ccfea994f add local echo prediction engine, integrate into WASM client 2026-04-01 12:33:33 -07:00
realrasengan bde81c13f6 fix WASM OOM: reuse shadow emulator instead of allocating new ones on state miss 2026-03-31 21:07:22 -07:00
realrasengan 0284bd652a revert vt-go to v0.1.0 (v0.2.0 scrollback changes break mosh) v0.5.2 2026-03-31 19:19:02 -07:00
realrasengan c82251169f revert: use NewEmulator with scrollback (NoScrollback breaks mosh rendering) v0.5.1 2026-03-31 19:04:53 -07:00
realrasengan f065464e2c mosh server: disable scrollback in VT emulator (saves ~200MB/session) v0.5.0 2026-03-31 17:55:00 -07:00
realrasengan 534e7da40d fix state tracker desync: prune by throwawayNum instead of arbitrary limit 2026-03-31 17:34:29 -07:00
realrasengan 96ce8cef8d fix attr bitmasks: match ultraviolet (RapidBlink/Conceal shifted Reverse/Strike) v0.4.1 2026-03-30 21:30:50 -07:00
realrasengan 052945f9f8 fix fullRedraw skipping attributed spaces (nano title bar) 2026-03-30 21:28:20 -07:00
realrasengan aff8e0572a fix resize: accept first diff after reset without base state 2026-03-30 21:24:44 -07:00
realrasengan f70f18fc3f add DialConnRaw + RecvRaw for direct transport access in WASM v0.4.0 2026-03-30 20:55:37 -07:00
realrasengan 8d9bc2eba0 add framebuffer state tracking to WASM client (match Dart)
- Transport: expose LastRecvOldNum/LastRecvNewNum for state tracking
- WASM: stateTracker with shadow VT emulator and received states map
- Each diff applied to base state copy, stored by newNum
- Display diffing: only changed cells sent to terminal
- Eliminates garbled output from missed diffs and state transitions
- Build with -tags osusergo for WASM os/user compatibility
2026-03-30 20:47:18 -07:00
realrasengan 4a40090a5f switch to unixshells/vt-go, ungate framebuffer for WASM
- Replace charmbracelet/x/vt with unixshells/vt-go (IRM support)
- Remove ultraviolet import from framebuffer.go (use local attr constants)
- Framebuffer compiles for all platforms including js/wasm
- WASM build requires -tags osusergo for os/user compatibility
2026-03-30 20:35:55 -07:00
realrasengan b71a9c5824 fix key repeat: only create new state when previous is acked (match Dart client)
The Dart mosh client only calls sendNew() when hasPendingState is false.
The Go client was calling SetPending on every tick with dirty=true, which
reset diffSent and caused new sequence numbers for the same cumulative
payload. Now tick() checks AckedByRemote >= SentNum before calling
SetPending — at most one unacked state in flight, matching the Dart
client's behavior.
v0.3.0
2026-03-30 19:56:45 -07:00
realrasengan 2939a82eca add 60s association timeout: kill mosh server if no client connects
Prevents stale mosh servers from failed setups holding relay bridges
indefinitely. Once a client connects, the 24h network timeout applies.
2026-03-30 19:46:22 -07:00
realrasengan c582e52c15 WASM: replace goroutine recv with JS-driven poll() to prevent scheduler starvation 2026-03-30 18:53:48 -07:00
realrasengan ad1792735e WASM: tick immediately when idle, batch when ack pending 2026-03-30 18:45:45 -07:00
realrasengan 1694f8c993 WASM: remove tick from send, let interval handle all flushing 2026-03-30 18:44:31 -07:00
realrasengan ecc46b8df2 WASM: batch keystrokes per animation frame to prevent cumulative state duplication 2026-03-30 17:25:05 -07:00
realrasengan 83b9ce0de5 WASM: defer next datagram read via setTimeout to yield to Go scheduler 2026-03-30 16:42:33 -07:00
realrasengan 37159d31bd WASM: use persistent writer, fix connection lost from lock churn 2026-03-30 16:19:17 -07:00
realrasengan 30eb6a82a5 WASM: tick immediately on send/resize, slow keepalive interval only 2026-03-30 16:07:58 -07:00
realrasengan cc1f22485d remove immediate Tick from send/resize — let setInterval drive it 2026-03-30 15:43:33 -07:00
realrasengan d8d48e4269 fix WASM: self-chaining JS reader, no goroutine leak, per-write lock 2026-03-30 14:35:40 -07:00
realrasengan 5f8cade139 add Tick() export and DialConnManual for JS-driven send loop in WASM 2026-03-30 14:24:44 -07:00
realrasengan bbe416444b add Conn interface, WASM client with WebTransport transport
- Conn interface: abstracts datagram I/O (Read/Write/SetReadDeadline/Close)
- Client.DialConn(): create client over any Conn (not just UDP)
- cmd/mosh-wasm: WASM binary exposing moshConnect(url, key) to JS
- WebTransport adapter: browser datagrams as mosh.Conn
- Build tags: server.go and framebuffer.go excluded from js/wasm
- Shared constants moved to conn.go

Existing UDP paths unchanged. Latch unaffected.
2026-03-30 12:05:33 -07:00
realrasengan 0f15d99fbc transport: SSP state tracking for framebuffer ack
Add AckedByRemote/SentNum accessors, diffOldNum locking, and
received state list for proper old_num validation. Required for
server framebuffer diffing to track which state the client has.
v0.2.1
2026-03-14 20:40:53 -07:00
realrasengan b8b5994527 server: VT emulator framebuffer diffing
Replace raw PTY passthrough with proper VT emulator processing.
PTY output feeds into charmbracelet/x/vt, snapshots are diffed
against the last-acked framebuffer using CUP-based positioning.
Fixes character doubling during fast typing.
2026-03-14 20:34:30 -07:00
realrasengan bb08f71e30 Initial release: pure Go mosh client and server
Wire-compatible with C mosh. AES-128-OCB3, SSP transport, fragmentation,
protobuf state sync, latch extension fields.

Includes ServeRW bridge mode for embedding.
v0.1.0
2026-03-12 18:33:41 -07:00