6aed2f3634960cf4e4825f94fd110a7d3ec9ad44
TerminalSession:
- shell integration: ensureShell() opens PTY+shell with emulator created
first (renderable during handshake); channel onClose -> CLOSED
- I/O API: sendBytes/sendText/sendKey (DECCKM-aware)/sendPaste
(bracketed-paste aware); resizeTerminal -> emulator.resize + pty
window-change; OSC 0/2 title wins over label; inputVersion counter
lets the canvas snap back to live view on any user input
TerminalCanvas:
- full-area Canvas renderer; cell size from measureText('M')
- merged style runs (one fillText per run), wide-cell 2-cell spans
- dirty-row incremental redraw live, full redraw while scrolled back
- block/underline cursor, always visible on alternate screen
- xterm-256 palette + truecolor + reverse/dim/bold/italic/underline/strike
- pinch zoom 6-30vp with persisted setting; PTY resize on relayout
- touch: SGR mouse reports in mouse mode, else scrollback drag + tap
focuses the hidden 1px IME anchor TextInput
KeyboardToolbar (Haven default two-row layout):
- Row1: snippets/keyboard/Esc/Tab/Paste/Text///Home/Up/End/PgUp
- Row2: Shift/Ctrl/Alt/arrows/PgDn/|/~/\backslash/`
- sticky modifiers: one-shot tap, double-tap lock (bordered), consume
on dispatch; Ctrl+symbol via ch & 0x1f; Alt prefixes ESC
TerminalPage:
- READY body mounts canvas + toolbar + whole-line text input overlay
(CJK path) + snippet macro panel (^C ^D ^Z ^L ^A ^E ^W ^U Shift-Tab)
- soft-keyboard toggle via FocusController on the hidden IME anchor
SettingsPage:
- color scheme picker with live preview blocks (4 schemes)
- font size slider 6-30vp, keep-screen-on toggle (window API)
- about (AGPL-3.0 + upstream attribution), diagnostics entry
Haven for HarmonyOS
Free, open-source SSH client for HarmonyOS — a port of Haven (Android) by GlassHaven.
SSH · VT100/xterm terminal · connection & key management.
Status
MVP (0.1.x) — SSH terminal + connection management:
- Pure TypeScript SSH-2.0 stack (no native libraries)
- KEX:
curve25519-sha256,ecdh-sha2-nistp256, strict-kex - Ciphers:
aes128/256-gcm@openssh.com,aes128/192/256-ctr - MACs:
hmac-sha2-256/512(+ EtM variants) - Auth: password, publickey (
ssh-ed25519,ecdsa-sha2-nistp256,rsa-sha2-256/512) - Host key TOFU verification with SHA256 fingerprints
- KEX:
- VT terminal emulator with 256-color/truecolor, alternate screen, mouse modes, bracketed paste, OSC 52 clipboard, CJK double-width, scrollback
- Connection manager with quick connect (
user@host[:port]), color tags - On-device SSH key management (generate / import / copy public key)
- Keyboard toolbar with sticky Ctrl/Alt and macro snippets
- English + 简体中文
Requires OpenSSH ≥ 7.4 on the server side.
Build
Open in DevEco Studio (API 26+), or:
hvigorw assembleHap
License
This project is a port of Haven (GlassHaven, AGPL-3.0). The SSH protocol stack and terminal emulator are re-implemented in TypeScript following the algorithms and behavior of the original (JSch defaults / libvterm feature set).
See NOTICE.md for attributions.
Languages
Kotlin
88.2%
Rust
4%
TypeScript
3.3%
C
1.6%
Shell
1.3%
Other
1.5%