Description
Vietnamese input methods (e.g. Unikey, EVKey, macOS built-in Vietnamese Telex/VNI) cannot type accented characters into SwiftUI TextField components in Hermes Desktop. Characters with diacritics (â, ê, ô, ơ, ă, ư, etc.) are either dropped, duplicated, or inserted incorrectly. The input method composition window may flicker or fail to commit characters.
This affects all text fields in the app: New Host form, session search, skill editor, and any other SwiftUI TextField.
Steps to Reproduce
- Enable a Vietnamese input method (Unikey, EVKey, or macOS built-in Vietnamese Telex)
- Open Hermes Desktop v0.9.0
- Navigate to any text field — try New Host dialog (Hermes → New Host)
- Type Vietnamese text with accents — e.g. "kết nối" or "quản lý"
- Observe: accented characters do not appear correctly or are dropped
Expected Behavior
Vietnamese Unicode characters with diacritics should be entered correctly, exactly as they work in native macOS apps (Notes, Safari, Terminal, Xcode) and AppKit-based text fields.
Actual Behavior
- Accented characters are dropped or mangled
- The text field shows only the base character without the diacritic mark
- In some cases the composition window fails to commit the character
- Some fields swallow the IME input entirely
Environment
- App version: 0.9.0 (also reproducible on earlier versions)
- macOS version: 15.7.5 (Sequoia)
- Hardware: Apple Silicon Mac
- Input methods tested:
- Unikey (via EVKey engine)
- macOS built-in Vietnamese Telex (Cài đặt → Bàn phím → Phương thức nhập liệu → Tiếng Việt)
Root Cause (analysis)
SwiftUI's TextField on macOS has a known limitation with Input Method Editors (IME). Unlike AppKit's NSTextField/NSTextView, which properly implement the NSTextInputClient protocol, SwiftUI's text fields do not always handle the IME composition → commit lifecycle correctly for East Asian and Southeast Asian scripts (Chinese, Japanese, Korean, Vietnamese).
The terminal component (which uses SwiftTerm, based on AppKit's NSTextView) handles Vietnamese input correctly — suggesting the issue is specific to SwiftUI's own TextField implementation.
Workaround (temporary)
- Type Vietnamese text in another app (TextEdit, Notes) → copy → paste into Hermes Desktop
- Use the Terminal tab (SwiftTerm) — IME works correctly there
- Add text via
hermes CLI directly in Terminal
Suggested Fix
- Replace critical SwiftUI
TextField components with NSViewRepresentable wrapping NSTextField/NSTextView
- Or use a custom
NSViewRepresentable that explicitly conforms to NSTextInputClient
- Or consider using
.onReceive with NSControl.textDidChangeNotification to properly handle IME commit events
Description
Vietnamese input methods (e.g. Unikey, EVKey, macOS built-in Vietnamese Telex/VNI) cannot type accented characters into SwiftUI
TextFieldcomponents in Hermes Desktop. Characters with diacritics (â, ê, ô, ơ, ă, ư, etc.) are either dropped, duplicated, or inserted incorrectly. The input method composition window may flicker or fail to commit characters.This affects all text fields in the app: New Host form, session search, skill editor, and any other SwiftUI
TextField.Steps to Reproduce
Expected Behavior
Vietnamese Unicode characters with diacritics should be entered correctly, exactly as they work in native macOS apps (Notes, Safari, Terminal, Xcode) and AppKit-based text fields.
Actual Behavior
Environment
Root Cause (analysis)
SwiftUI's
TextFieldon macOS has a known limitation with Input Method Editors (IME). Unlike AppKit'sNSTextField/NSTextView, which properly implement theNSTextInputClientprotocol, SwiftUI's text fields do not always handle the IME composition → commit lifecycle correctly for East Asian and Southeast Asian scripts (Chinese, Japanese, Korean, Vietnamese).The terminal component (which uses SwiftTerm, based on AppKit's
NSTextView) handles Vietnamese input correctly — suggesting the issue is specific to SwiftUI's ownTextFieldimplementation.Workaround (temporary)
hermesCLI directly in TerminalSuggested Fix
TextFieldcomponents withNSViewRepresentablewrappingNSTextField/NSTextViewNSViewRepresentablethat explicitly conforms toNSTextInputClient.onReceivewithNSControl.textDidChangeNotificationto properly handle IME commit events