Cawide Team//Updated November 25, 2026

Typing Vietnamese in a remote terminal without breaking it

Learn how input method engines break character composition in raw terminals, and how Cawide handles Vietnamese Telex, VNI, and CJK typing cleanly.

Typing Vietnamese or CJK in a remote terminal often breaks character composition because raw terminal PTYs process keystrokes character-by-character as raw bytes, sending backspaces and intermediate Latin characters directly to the shell before composition is complete.

Cawide solves this by buffering text in an IME-safe composition layer on iOS before flushing finalized UTF-8 tokens into the pseudo-terminal stream.

Why does typing Vietnamese Telex or VNI break in a standard terminal?

To understand why typing breaks, consider how Vietnamese input methods work compared to how a standard terminal emulator processes input.

In Vietnamese Telex:

  • Typing v, then i, then e, then t, then j produces the single accented word việt.
  • In standard GUI text fields (such as a text editor or web browser), the operating system Input Method Engine (IME) maintains a temporary pre-edit buffer (marked text).
  • As you type e after e, the engine replaces the two characters with ê. As you type j, it appends the underdot tone mark to form ệ.

Standard terminal emulators, however, operate in raw character mode:

  1. When you type v, the terminal emulator immediately sends ASCII byte 0x76 over the network socket to the remote shell.
  2. When you type i, it sends 0x69.
  3. When you type e and then another e, the terminal sends two individual byte events.
  4. When the IME tries to correct the text into ê, it sends a series of destructive backspace characters (0x08 or 0x7F) followed by the UTF-8 bytes for ê.

If network latency is non-zero, or if you are running an interactive CLI program like Claude Code, git commit editor, or bash with auto-completion, these rapid backspaces arrive after the shell has already rendered auto-suggest ghosts, syntax highlights, or prompt decorations. The line buffer gets corrupted, cursor positions desynchronize, and trailing characters like s, f, r, x, j appear as literal English letters instead of tone marks.

How does the iOS keyboard interact with PTY streams?

On mobile devices, this problem is amplified by the native iOS software keyboard:

  • Autocorrect and prediction: The iOS software keyboard continually modifies uncommitted words based on machine learning language models and dictionaries.
  • Marked text lifecycle: In UIKit and SwiftUI, text fields conform to the UITextInput protocol. When you type on iOS, the keyboard creates marked text with an active selection range, waiting for a word boundary (such as Space or Return) to commit.
  • PTY byte stream mismatch: A Unix PTY device (/dev/pts/*) expects a linear stream of bytes. It has no native protocol understanding of UITextInput marked text ranges, replacement ranges, or input candidates.

When an unadapted terminal app connects an iOS keyboard directly to a PTY stream, every intermediate predictive guess sends a storm of conflicting byte sequences across the network. If your network connection has 50 ms of jitter, typing a prompt like Hãy kiểm tra file này turns into corrupted garbage on the remote screen.

How does Cawide implement IME-safe terminal composition?

Cawide bridges the gap between iOS UITextInput and the SwiftTerm terminal engine using an isolated composition buffer:

  1. Pre-edit isolation: While you are actively composing a word in Vietnamese (Telex or VNI) or entering CJK characters, Cawide holds the composition state inside the client-side text buffer.
  2. Local visual feedback: Marked text is underlined and rendered locally in the terminal view, allowing you to see the word transform accurately without sending incomplete fragments to the remote host.
  3. Atomic UTF-8 commit: Only when the iOS input method finalizes the token (upon pressing Space, a punctuation key, Enter, or selecting a candidate) does Cawide encode the completed Unicode string into UTF-8 and dispatch it to the host PTY.
  4. Clean prompt submission: The remote shell receives clean, cohesive character tokens. Line editors like readline or zsh-autosuggestions receive the final word in a single packet, preventing cursor jitter and phantom backspaces.

In loopback benchmarks recorded on Apple Silicon hardware, keystroke round trip latency is p50 2.75 ms and p99 14.35 ms (200 samples), with terminal throughput reaching 24 MB/s and full 256 KiB scrollback replay taking 31 ms. Loopback benchmark on Apple Silicon (host and app on one machine). Real-world latency adds your network round trip.

How does the Smart Action Bar support coding symbols on mobile?

Even with clean IME text composition, coding from a smartphone introduces a second major typing obstacle: symbol accessibility.

Programming commands and agent prompts require frequent use of characters that do not exist on the primary alphabetical keyboard layout:

  • Escape key for dismissing autocomplete menus or switching modes in vim.
  • Control and Option/Alt modifiers for sending terminal signals (Ctrl+C, Ctrl+D, Ctrl+Z).
  • Dedicated coding symbols such as ~, /, \, |, -, _, :, ;, `, $, =, and ".

Switching to the numeric layout on iOS, finding the special symbol layer, tapping the character, and switching back to letters breaks your thinking flow.

Cawide includes a dedicated Smart Action Bar positioned directly above the software keyboard:

  • One-tap buttons for Esc, Tab, Enter (↵), and arrow keys (←, ↑, ↓, →).
  • Persistent toggles for Ctrl, Option, Command, and Shift.
  • Dedicated symbol strip containing the most common programming punctuation.
  • Attachment button allowing you to take a photo, select an image from your photo library, or attach a workspace file (uploads capped at 8 MB).

Does dictation work for terminal prompts?

Yes. Because Cawide implements standard iOS UITextInput protocol conformance, the microphone dictation key on the native iOS keyboard works out of the box.

In addition to keyboard dictation, Cawide features built-in Voice Prompting accessible directly from the mic key on the Smart Action Bar. With AI Prompting, you can dictate naturally in any mix of languages: filler words and false starts are cleaned up, corrections are applied automatically, and a structured prompt is pasted into the terminal.

Combining clean IME composition with the Smart Action Bar, Voice Prompting, and native iOS dictation allows you to prompt AI coding agents accurately from anywhere.

Run coding agents from your pocket

Install the Cawide CLI on your computer and control your AI agents from your iPhone with a real terminal and instant approval alerts.