How the Enter key modes work
mainThe hook provides two modes to handle how the Enter key behaves, which is useful for balancing ease of use with IME (Input Method Editor) stability (e.g., for Japanese or Chinese users).
mod-enter: Recommended for IME-heavy languages.EnterandShift+Enterboth insert a line break.Cmd/Ctrl+Entertriggers the submission.enter: Standard chat behavior.Entertriggers submission.Shift+Enterinserts a line break.Cmd/Ctrl+Enteralso triggers submission.
Both modes include a two-step check using KeyboardEvent.isComposing to ensure the hook never submits while a user is composing characters via an IME.
| `options.mode` | Enter | Shift+Enter | Cmd/Ctrl+Enter |
| -------------- | ------- | ----------- | -------------- |
| `mod-enter` | Line break | Line break | Submit |
| `enter` | Submit | Line break | Submit |