fix(config): stop forcing ascii_mode in VSCode - #1174
Closed
JeremyLiu858 wants to merge 1 commit into
Closed
Conversation
`app_options/com.microsoft.VSCode/ascii_mode: true` was uncommented in bdf1114 (2017-09-22, "chore(config): ascii mode in code editors") as part of a batch that also enabled Xcode, TextWrangler, TextMate, Atom, Sublime Text 2, Aquamacs and Emacs. VSCode was never evaluated on its own, and the rationale was simply that code editors are for writing code. That premise no longer holds. VSCode now hosts extension webview chat boxes, SCM commit messages, comment threads and Markdown editing, all of which are ordinary Chinese-input surfaces. IMK allocates one controller — and therefore one rime session, and one `ascii_mode` — per bundle id, so the option cannot be scoped to the editor pane; it necessarily covers the whole application. Because `ascii_mode` is absent from `save_options` while schemas declare `ascii_mode: reset: 0`, the option re-arms on every new session. Users who have remapped `ascii_composer/switch_key` away from the defaults are then left with no ordinary key to escape ASCII mode, and Chinese input appears to be entirely broken — while macOS's built-in IME, which has no per-application option system, keeps working. That asymmetry sends users looking for the cause anywhere but here: rime#141, rime#264, rime#566, rime#987, rime#1027, rime#1076. See also rime#584, where the reporter found `app_options` only by accident. The default is dropped rather than inverted, and the comment documents how to restore it. Users who prefer ASCII in VSCode press their normal Chinese/English switch key, exactly as in every other application. The remaining `ascii_mode` entries are untouched. Fixes rime#987 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author
|
Withdrawing this — on reflection the 2017 default looks deliberate rather than accidental, and this is better raised as discussion on #987 than as a unilateral change to a shipped default. Sorry for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app_options/com.microsoft.VSCode/ascii_mode: truefromdata/squirrel.yamlapp_optionsentry is touchedMotivation
This entry was uncommented in bdf1114 (2017-09-22, "chore(config): ascii mode in code editors")
as part of a batch that also enabled Xcode, TextWrangler, TextMate, Atom, Sublime Text 2, Aquamacs
and Emacs. It had been added commented-out a month earlier in fc61f85. Neither commit references an
issue or gives a rationale beyond the subject line, and VSCode was never evaluated on its own — the
premise was simply that code editors are for writing code. In 2017 that was true of VSCode 1.16.
It is no longer true. VSCode today hosts extension webview chat boxes (Copilot Chat, Claude Code,
Cline, Continue), SCM commit messages, comment threads, Markdown and plaintext editing — all
ordinary Chinese-input surfaces.
Crucially, the option cannot be scoped to the editor pane.
IMKInputControlleris allocated perbundle identifier, so
updateAppOptions()appliesascii_modeto one rime session that covers theentire application, webviews included.
Why this is so hard for users to diagnose
ascii_modeis absent fromswitcher/save_options, while schemas declareascii_mode: reset: 0.The option therefore re-arms on every new session, not once. A user who has remapped
ascii_composer/switch_keyaway from the defaults — a very common customisation — is left with noordinary key to escape ASCII mode inside VSCode.
The symptom that produces is "Squirrel cannot type Chinese in VSCode at all, but macOS's built-in
IME can". Because
app_optionsis a Rime-only concept, Apple's IME is structurally immune, andthat asymmetry sends users looking for the cause anywhere except a config default:
The reporter of #987 ticked the box "换用macOS系统自带输入法,可以输入中文" — the exact asymmetry.
See also #584, where the reporter discovered
app_optionsonly by accident: "好家伙, 原来不是bug, 是默认给关闭掉了", and 14 commenters thankedthem for it. #1076 is worth a look too: that user did apply the documented patch, but put it in
default.custom.yaml, whereapp_optionsis silently ignored because it belongs tosquirrel.yaml.Measurement
macOS 26.4.1, Squirrel 1.1.2, luna_pinyin, typing into a VSCode extension webview.
Counting
InputMethodKitactivity in the unified log(
log show --predicate 'process == "Squirrel"' --info --debug):Setting marked textInserting textascii_mode: false+ deployBefore the change, rime composed nothing at all. The single
Setting marked textis an artifact ofthe first keystroke only:
selRangestarts asNSRange(NSNotFound, 0), soshow()'s cache missesonce and then matches forever while the preedit stays empty.
Impact
What changes. VSCode sessions now start in the schema's default mode like every other
application, instead of being forced to ASCII.
Users who prefer ASCII in VSCode press their normal Chinese/English switch key, exactly as they
already do everywhere else — or restore the old behaviour explicitly:
Users who already patched
ascii_mode: falseare unaffected; their patch becomes a harmlessno-op.
The asymmetry is what motivates dropping the default rather than keeping it: recovering from
"stuck in English" requires discovering that
app_optionsexists, knowing it lives insquirrel.custom.yamland notdefault.custom.yaml, and writing patch syntax. Recovering from"started in Chinese" is one keypress.
I deliberately kept this narrow. The sibling entries raise the same question to different degrees —
Atom was archived in 2022, Sublime Text 2 dates from 2011, TextWrangler was discontinued in 2017 —
but they are separate judgement calls and I did not want to bundle them into a change that can be
evaluated on its own. Happy to follow up on those, or to adjust the wording of the comment, if
maintainers would prefer a different shape.
Fixes #987