{"slug": "show-hn-foretype-type-on-remote-machines-at-local-speed", "title": "Show HN: Foretype: type on remote machines at local speed", "summary": "Developer Fabio Roma released Foretype, an Apache-2.0 Rust tool that predicts keystrokes locally on remote machines to cut on-screen typing latency from 160 ms to 10 ms over a ~150 ms connection. Foretype installs as a login shell, runs the user's real shell in a pseudo-terminal, and draws predicted keys when the remote program takes longer than 30 ms to echo, taking predictions back if the real echo differs or does not arrive within roughly three round trips. The tool requires nothing installed on the server and leaves ssh, shell config and the server untouched.", "body_md": "**Type on remote machines at local speed.**\n\nA Rust tool that forecasts your typing, drawing each key before the server echoes it back.\n\n<sub>Top: plain ssh. Bottom: foretype. Same keys at the same moment, to a deliberately laggy server ~440 ms away.</sub>\n\n```\n                       without     with foretype\nbash over ssh           160 ms        10 ms\ncoding agent over ssh   148 ms        11 ms\nany laggy console       158 ms        10 ms\n```\n\n<sub>A separate measurement, server ~150 ms away. Median time from keypress until the\ncharacter is on screen; with foretype that is the locally drawn prediction, and the real\necho still arrives at network speed. Measured with `scripts/latency.py`.</sub>\n\n```\ngit clone https://github.com/itsfabioroma/foretype && cd foretype\n./install.sh\n```\n\nTo try it without installing, run `cargo build --release`, then\n`FORETYPE_SHELL=$SHELL ./target/release/foretype shell`. That runs your shell inside\nforetype in the current terminal; `exit` leaves.\n\nOpen a new terminal tab. That's it. Typing into anything slow now feels instant: ssh,\n`kubectl exec`, `docker exec`, a coding agent on a far box. Nothing to install on the\nserver, and your shell, prompt and config stay the same.\n\n```\nforetype status             # is this tab boosted?\nsudo foretype uninstall     # put your old shell back\n```\n\nforetype is a single Rust binary. `foretype install` copies it to `/usr/local/bin`, adds\n`foretype-shell` to `/etc/shells`, makes that your login shell with `chsh`, and saves\nyour old shell in `~/.config/foretype/shell`. Every new terminal tab, tmux pane and\neditor terminal then starts foretype, which runs your real shell in a pseudo-terminal\nand forwards every byte unchanged. It mirrors the screen with\n[vt100](https://crates.io/crates/vt100) and times how long each key takes to echo. When\nthe program in front is slower than 30 ms, foretype draws your keys itself, then checks\nthem against the real echo.\n\n- Only interactive terminals are wrapped. `-c` commands, scripts and pipes get your real\nshell directly.\n- ssh, your shell config and the server are untouched. Root is only needed to install and uninstall.\n- Predicts only after the program has echoed on that line, so passwords stay hidden.\n- Asks the terminal for its cursor position (`ESC [6n` ) before drawing.\n- Restores the cursor before forwarding output, so the program's bytes land untouched.\n- Takes a prediction back if the echo differs, or if none arrives within about three round trips (750 ms at least, 5 s at most).\n- Pauses on Enter, editing keys, paste and resize.\n- Hides typing lag, not network lag.\n\nApache-2.0", "url": "https://wpnews.pro/news/show-hn-foretype-type-on-remote-machines-at-local-speed", "canonical_source": "https://github.com/itsfabioroma/foretype", "published_at": "2026-10-12 01:59:06+00:00", "updated_at": "2026-10-12 02:07:34.528202+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["Foretype", "Fabio Roma", "Rust", "vt100", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-foretype-type-on-remote-machines-at-local-speed", "markdown": "https://wpnews.pro/news/show-hn-foretype-type-on-remote-machines-at-local-speed.md", "text": "https://wpnews.pro/news/show-hn-foretype-type-on-remote-machines-at-local-speed.txt", "jsonld": "https://wpnews.pro/news/show-hn-foretype-type-on-remote-machines-at-local-speed.jsonld"}}