Per-app option to show composition only in the candidate panel, without calling setMarkedText (works around a Terminal.app 2.15 crash on macOS 27)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with the placeholder marked-text logic in SquirrelInputController and the per-app handling of no_inline and inline_preedit in app_options. Add a no_marked_text option that implies no_inline and stops any setMarkedText: call for that client, sending text only through insertText:. Done means a client with the option never receives marked text, the candidate panel still shows the composition, and the default behavior is unchanged. Confirm the cursor position still comes from attributesForCharacterIndex: and firstRectForCharacterRange:.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On macOS 27.0.1, Terminal.app 2.15 (488) crashes or drops its window when an input method keeps marked text in the view while the pty keeps producing output (e.g. tmux with a status line / clock / several panes). The fault is in Terminal (-[TTView setMarkedText:…] → -[TTLogicalScreen displayPositionForUnicharOffset:] → NSRangeException; reported to Apple), not in Squirrel — but Squirrel is the only side a user can change today.
Squirrel currently always keeps marked text in the client:
inline_preedit: true→ the composition string is the marked text;no_inline: true→ Squirrel still sets a placeholder marked text (a full-width space, the iTerm2 workaround inSquirrelInputController), so Terminal still re-anchors a marked range on every output batch.
Either way Terminal walks the broken path. We measured 17 NSRangeException events in 10 hours and 6 hard crashes in 5 days on one machine, every one of them within the same second as a Squirrel "Setting marked text" IMK log line.
Request
A per-app option (in app_options), e.g. no_marked_text: true, meaning: never call setMarkedText: for this client; show the raw composition only in the candidate panel (preedit line), and send text only via insertText:. For Terminal that completely avoids the Apple bug, and the UI loss is small (no inline preedit, which Terminal users with no_inline: true already accept).
Suggested semantics:
no_marked_text: trueimpliesno_inline: true(panel shows the preedit).- No placeholder marked text is set; cursor position for the panel is taken from the client's
attributesForCharacterIndex:/firstRectForCharacterRange:of the current insertion point, as today. - Default
false, so nothing changes for existing users.
Evidence (available on request)
- 6 Terminal crash logs (.ips), symbolicated against Terminal's ObjC method table: crash path is
-[TTView drawRect:]→drawAttributedString:…isTextMarked:…→-[TTLogicalScreen unicharOffsetForDisplayPosition:]→expandUnicharOffsetCacheToLine:→ NSRangeException →+[NSApplication _crashOnException:]. - Logged (non-fatal) path:
TTIOManager mainThread → TTTabController shellDidReceiveData: → TTVT100Emulator decodeData: → -[TTView setMarkedText:selectedRange:replacementRange:] → displayPositionForUnicharOffset:→ NSRangeException, after which the window content is corrupted / the window closes. - Disassembly of
expandUnicharOffsetCacheToLine:shows the bounds check (line >= lineCount→ raise). - Apple Feedback Assistant report filed in parallel (FB number will be added here once assigned).
Environment
macOS 27.0.1 (26A434), Mac16,10; Terminal 2.15 (488); Squirrel 1.1.2; rime-liur schema; tmux 3.7c.
- Lingua principale
- Swift
- Stelle
- 6.6k
- Fork
- 586
- Merge medio
- 1g 19h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rime/squirrel
-
停用自动更新提示的说明Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 56/100
-
XML encoding declaration mismatch in .strings files causes localized names to failForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
[Feature request] 按候选窗宽度自动决定每页候选数 / Fill candidate page by panel width instead of fixed page_sizeAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
[Bug] macOS 27 输入源切换 HUD 中鼠须管图标为不透明浅色底板Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
Tutte le issue di rime/squirrel
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
manaflow-ai/cmux#59692 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
DuarteSantos8/openGym#1582 ·
I maintainer di solito rispondono entro 5 giorni