Double-click word selection: treat consecutive CJK characters as a single word #12566
Unanswered
l-qing
asked this question in
Issue Triage
Replies: 1 comment
-
|
Firefox and Chromium both select 已经.
In my Ghostty, double-clicking |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
When I double-click an English word in Ghostty, the whole word is selected — as expected. But when I double-click a Chinese character, only that single character is selected, even when surrounded by other Chinese characters with no whitespace or punctuation between them.
Example (the
|marks where I double-clicked):hello wor|ld foo→worldis selected ✅配置文件已|经更新→ only经is selected ❌ (expected:配置文件已经更新, or at least已经更新)The same applies to Japanese (Hiragana/Katakana/Han) and Korean (Hangul) text.
Comparison with other terminals
Ghostty is the only terminal in my daily rotation where I have to triple-click (whole line) or drag-select to grab a Chinese phrase, which is a noticeable papercut for CJK users.
Why
selection-word-charsdoesn't helpselection-word-charsonly adds boundary characters; there's no way to express "treat this whole Unicode script as word-class". So the current behavior — each CJK codepoint ending up as its own word — cannot be worked around in config today.Proposed behavior
Treat a continuous run of codepoints from any of these Unicode blocks/scripts as a single word for double-click selection (the same way ASCII letters/digits are):
U+4E00–U+9FFF,U+3400–U+4DBF,U+20000–U+2A6DF, …)U+3040–U+309F)U+30A0–U+30FF,U+31F0–U+31FF)U+AC00–U+D7AF,U+1100–U+11FF,U+3130–U+318F)selection-word-charswould still apply on top, so users can punch holes (e.g. add、,。as boundaries) if they want finer breaks.Optional: make it opt-in / configurable
If maintainers prefer not to change the default, a config like:
would also solve the problem and keep the door open for other scripts (Thai, Arabic, etc.) later.
Prior art / related discussions
Searched issues and discussions for
CJK,chinese,ideograph,双击,汉字,selection-word-chars,smart selection,double-click word. Adjacent topics:None of them address the CJK / Unicode-script angle, hence this new discussion.
Environment
Beta Was this translation helpful? Give feedback.
All reactions