From d9f4b4b6ccc4f063fc0db84933a20df360ea41b7 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Mon, 24 Aug 2026 14:29:38 +0300 Subject: [PATCH] fix(terminal): stop mobile keyboards auto-capitalizing terminal input ghostty-web marks the terminal container contenteditable but only its hidden textarea opts out of IME text mangling, so iOS and Android keyboards uppercased the first letter of every command. Set autocapitalize/autocorrect/spellcheck off on the container after open. --- packages/ui/src/components/terminal/TerminalViewport.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/ui/src/components/terminal/TerminalViewport.tsx b/packages/ui/src/components/terminal/TerminalViewport.tsx index 82657445..33d9eded 100644 --- a/packages/ui/src/components/terminal/TerminalViewport.tsx +++ b/packages/ui/src/components/terminal/TerminalViewport.tsx @@ -245,6 +245,13 @@ const TerminalViewport = React.forwardRef(({ const fitAddon = new module.FitAddon(); terminal.loadAddon(fitAddon); terminal.open(container); + // ghostty-web marks the container contenteditable for touch IME input but + // sets autocapitalize/autocorrect only on its hidden textarea. Mobile + // keyboards (iOS and Android) therefore auto-capitalize the first letter + // of every terminal command; disable IME text mangling on the container. + container.setAttribute('autocapitalize', 'off'); + container.setAttribute('autocorrect', 'off'); + container.setAttribute('spellcheck', 'false'); terminalRef.current = terminal; fitRef.current = fitAddon; subscriptions = [terminal.onData((data) => inputRef.current(data))];