The invisible macOS keyboard ghost that snaps your input source back to English every time you switch apps.
Tiny (~60 KB) · Zero Permissions · No Menu Bar Clutter · Apple Silicon & Intel
English | 简体中文
If you type in Chinese, Japanese, Korean, Russian, Arabic, Thai, or any other non-English input method on macOS (including third-party IMEs like Sogou, WeChat IME, or Rime), you know the pain: you finish replying to a message in a chat app, switch back to your terminal, IDE, or browser, start typing a command or shortcut—and accidentally type a string of non-English characters.
KeyGhost haunts your background quietly and natively:
| Feature | 👻 KeyGhost | Typical GUI Switchers |
|---|---|---|
| Accessibility / Input Monitoring Permission | ❌ Not needed | ✅ Required |
| Menu Bar / Dock Icon | Invisible | Always visible |
| Binary Size | ~60 KB | 10 – 50 MB |
| Memory Usage | < 3 MB | 30 – 100 MB |
| Install Time | 10 seconds (1 command) | Download, drag, grant permissions |
| Privacy | Never reads keystrokes | Often requires Input Monitoring |
No Xcode, no Git, no settings to tweak.
- Press
⌘ Command + Space, typeTerminal, and pressEnter. - Paste the command below and press
Enter:
curl -fsSL https://raw.githubusercontent.com/Lihaila/keyghost/main/scripts/quick-install.sh | bash- Done! KeyGhost starts immediately and launches automatically every time you log in.
How to verify it works: Switch to Chinese/Japanese/Korean in any app, then click into another app — your input source in the top-right menu bar will instantly switch back to ABC / U.S.
Open Terminal and run:
curl -fsSL https://raw.githubusercontent.com/Lihaila/keyghost/main/scripts/uninstall.sh | bash(Add | bash -s -- --purge if you also want to delete your optional config file.)
Works out of the box with zero configuration — automatically detects ABC, U.S., or British, and falls back to your first enabled ASCII-capable keyboard layout (e.g. German, French, Dvorak, Colemak) if none of those are enabled.
If you want to exclude specific apps (e.g., keep Chinese when switching to WeChat) or choose a specific keyboard layout, create ~/.config/keyghost/config.json:
{
"targetInputSource": "com.apple.keylayout.ABC",
"excludedApps": [
"com.tencent.xinWeChat"
],
"switchOnWake": true
}Changes take effect automatically on your next app switch — no restart needed.
📋 Common App Bundle IDs (click to expand)
| App | Bundle ID |
|---|---|
| WeChat (微信) | com.tencent.xinWeChat |
| WeCom (企业微信) | com.tencent.WeWorkMac |
| DingTalk (钉钉) | com.alibaba.DingTalkMac |
| Feishu / Lark (飞书) | com.electron.lark |
com.tencent.qq |
|
| Apple Notes (备忘录) | com.apple.Notes |
Find any app's Bundle ID with:
osascript -e 'id of app "WeChat"'Find all enabled keyboard input source IDs on your Mac with:
~/.local/bin/keyghost --listIf you prefer inspecting and compiling the single Swift file yourself:
git clone https://github.com/Lihaila/keyghost.git
cd keyghost
make installUseful make targets:
make build— CompileSources/main.swifttobuild/keyghostmake install— Build, install, and start LaunchAgentmake status— Check if KeyGhost is runningmake list— List all enabled keyboard input source IDsmake uninstall— Stop and remove KeyGhost
Is it safe? Does it log my keystrokes?
No. The entire source code is ~200 lines in Sources/main.swift. It never requests Accessibility or Input Monitoring permissions and cannot read what you type. It only listens for macOS's built-in "app switched" and "system woke" notifications and calls Apple's TISSelectInputSource API.
Will it keep working after I restart my Mac?
Yes. The installer sets up a standard macOS LaunchAgent (~/Library/LaunchAgents/com.keyghost.agent.plist), so it starts automatically whenever you log in.
Why doesn't macOS have this built in?
macOS only offers "Automatically switch to a document's input source", which remembers the last input source per document/app instead of resetting to English. KeyGhost turns that option off and runs invisibly in the background so every app switch cleanly starts in English.