Skip to content

test(terminal): pin that the CJK block is the preedit overlay, not the cursor - #15242

Merged
nwparker merged 2 commits into
mainfrom
nwparker/terminal-cjk-preedit-block-tests
Aug 18, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/terminal-cjk-preedit-block-tests

Conversation

@nwparker

@nwparker nwparker commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​569 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​569
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

Refs #12729.

Neither claimed defect reproduces. The black block is not the cursor — it is the IME preedit overlay, and it was already fixed by #15014, which landed the day after the reported release.

Tests only; no production change.

Defect 1 — cursor on the wide char's first cell: does not reproduce

Replaying the reporter's own captured stream (ESC[?25l ESC[H ESC[2C ESC[24B 가나다라 ESC[30;1H ESC[25;11H ESC[?25h):

  • buffer.cursorX === 10 — column 11, exactly what CSI 25;11H requested. Not cell 8.
  • cells pair correctly: 가:2 ·:0 나:2 ·:0 다:2 ·:0 라:2 ·:0
  • the cursor renders as its own span after the run; forced onto the wide cell it carries the whole syllable (textContent === '라')

And the structural point: a block cursor inverts a cell, it does not mask it. It cannot hide half a glyph. That alone rules out every cursor-based explanation of "the right half is never drawn."

Defect 2 — cursor style/opacity ignored: not a plumbing bug

The settings path is intact end to end — explicit bar survives write and reload, applyTerminalAppearance writes cursorStyle to every mounted pane, opacity composes to rgba(...), and all 30 builtin themes define cursor, so the gate never silently drops it.

Two real findings, neither being the reported symptom:

  1. A DECSCUSR from the running program outranks the setting (decPrivateModes.cursorStyle ?? options.cursorStyle). Prompt frameworks emit this on every redraw. Correct terminal behaviour and matches other terminals — but it is the honest answer whenever someone says "my cursor setting does nothing."
  2. Cursor opacity genuinely does nothing for a block cursor under WebGL — the default style on the default renderer. The cursor colour is used as a cell background and the alpha is stripped (rgba >> 8 & 16777215). The DOM renderer keeps it. This is upstream in the webgl addon, not in xterm or in our code, and is left alone here.

What is actually happening

macOS 2-set Korean keeps the trailing syllable composing until a terminator. After typing 가나다라 only 가나다 has reached the pty; 라 lives in .composition-view, an opaque absolutely-positioned box anchored at the cursor cell and painted over the grid.

In v1.4.184 that box used stock upstream colours — background: #000; color: #FFF. That is the black block.

It accounts for every observation, including the ones no cursor theory can:

reported the overlay explains it
opaque regardless of cursor style/opacity it is not the cursor; no cursor option reaches it
identical with GPU acceleration off it is a DOM node above both renderers
Latin unaffected Latin never opens a composition
Enter makes it correct Enter commits the composition and clears the overlay
glyph unreadable / half missing an opaque box masks; a block cursor inverts

The follow-up comment's "it is not composition state" was inferred from "Enter fixes it" — but Enter is precisely the terminator that ends the composition.

Already fixed

453237cc57c (#15014, 2026-08-17) themes the overlay from options.theme with the alpha dropped, and renders the row tail it covers.

#15014 in v1.4.184?   NO   (v1.4.184 tagged 2026-08-16)
#15014 in main?       YES

So the answer to the reporter is "fixed, ships in the next release" — plus the separate upstream opacity gap above.

The tests

  • terminal-cjk-cursor-cell-placement.test.ts — pins defect 1's negative result so the cursor explanation cannot be re-derived
  • terminal-cursor-appearance-precedence.test.ts — settings round-trip, opacity composition, and DECSCUSR precedence including the reset handing control back
  • terminal-ime-xterm-trailing-preedit-occlusion.test.ts — pins the real mechanism: only 가나다 reaches the pty while 라 sits in a themed overlay at the cursor cell, cleared on commit. The theming assertion is the arm with teeth against 1.4.184, where the inline background was never set at all. Sits beside fix(terminal): render the row tail the IME preedit overlay covers #15014's existing mid-line arm; this is the end-of-row arm, which is the shape this issue hits.
Test Files  3 passed (3)      Tests  10 passed (10)

The strongest evidence, and the one measurement that argues against us

What actually rules out the cursor is structural, not arithmetic: a block cursor spans the whole wide glyph. Under the WebGL renderer — the default on macOS — lastCursorX = cursorX + cell.getWidth() - 1 and the fill runs x >= cursorX && x <= lastCursorX (addon-webgl WebglRenderer.ts:550,552). The DOM renderer puts the syllable inside the cursor span. So "the cursor covers one cell of a two-cell glyph" fails on both renderers. That closes it far harder than any pixel sum.

I want to retract an argument that appeared in an earlier draft of this description, because it was wrong and it dismissed careful work:

  • The 23 + 8×14 = 135 calculation has no discriminating power. Cell index 8 is column 9, which is the reporter's own stated cursor column. Both theories put the block's left edge at the same pixel. It restates their number rather than explaining it.
  • I claimed their pixel table derives cell width from the block and is therefore circular. It is not. The report carries a second, independent measurement — the Korean glyph advance 가→나→다 of 28px, over glyphs on the grid under either theory. Hangul occupies two cells, so cell width = 28/2 = 14px, derived without reference to the block at all.

With 14px standing on its own, the reported block width of 14px is exactly one cell — and the overlay would be two. .composition-view sets no width, only maxWidth, and is white-space: nowrap (CompositionHelper.ts:875-876), so a view holding one Hangul syllable renders about 28px.

That is the only measured quantity in the report that discriminates between the two explanations, and it points away from the overlay.

I still believe the overlay explanation, because it accounts for six independent observations that no cursor theory can, and because a block cursor provably cannot mask half a glyph. The most likely reading is that "Cell width (from the cursor block)" is ambiguous about which block was measured. But that is a mis-measurement hypothesis, and it should be stated as one rather than waved away.

Not verified

No visual confirmation — this rests on the structural argument above, the observations no cursor theory explains, and the code path, not on a screenshot.

The disputed width is settleable and is not settled here. happy-dom performs no layout, so every geometry assertion in these tests is attribute-level; the overlay's rendered width — the exact number the diagnosis turns on — cannot be asserted anywhere in this PR. The tooling already exists: tests/e2e/terminal-ime-preedit-overlay-probe.ts already returns getBoundingClientRect().width for .composition-view. An end-of-row arm alongside the existing mid-line spec, asserting a single Hangul syllable renders about two cells wide, would resolve 14 vs 28 outright. That is the highest-value follow-up and it is nearly free.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added Vitest and Playwright regression coverage for CJK cursor placement, wide-glyph rendering, cursor-style precedence, cursor opacity, and Korean IME composition. The tests configure xterm instances, mock canvas measurements, synchronize rendering, inspect cell state, simulate composition events, validate overlay dimensions and styling, verify final commits, and select the related E2E test for terminal IME changes.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed and on-topic but omits most required template sections, including ELI5, Visual Proof, Testing, Review, Notes, and Checklist. Reformat the description with every template heading, add the required visual-proof statement, testing and platform details, checklist status, and complete the Linked Issue field.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: tests establish that the CJK block is an IME preedit overlay rather than the cursor.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/terminal-cjk-cursor-cell-placement.test.ts (1)

2-16: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep both test headers concise.

Replace issue-analysis prose with a one-line regression description.

  • src/renderer/src/components/terminal-pane/terminal-cjk-cursor-cell-placement.test.ts#L2-L16: reduce the header to the CJK cursor-placement regression condition.
  • src/renderer/src/components/terminal-pane/terminal-cursor-appearance-precedence.test.ts#L2-L13: reduce the header to the cursor-precedence regression condition.

As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53ff5e4a-de23-496a-90fe-018459130531

📥 Commits

Reviewing files that changed from the base of the PR and between 9a41119 and 45b0b757a607f334b971215adfd9aaac4f8dc050.

📒 Files selected for processing (3)
  • src/renderer/src/components/terminal-pane/terminal-cjk-cursor-cell-placement.test.ts
  • src/renderer/src/components/terminal-pane/terminal-cursor-appearance-precedence.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-xterm-trailing-preedit-occlusion.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 1 remains after this review.

@nwparker
nwparker force-pushed the nwparker/terminal-cjk-preedit-block-tests branch from 45b0b75 to 30051b9 Compare August 18, 2026 05:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/terminal-cjk-cursor-cell-placement.test.ts (1)

2-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the test comments concise. Retain only the non-obvious regression contract; remove the report narrative and implementation walkthrough. The test names and assertions already document the covered cursor positions, renderer scope, synchronization, and IME behavior.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10221abb-c04d-4f9a-8c69-6bb642239190

📥 Commits

Reviewing files that changed from the base of the PR and between 45b0b757a607f334b971215adfd9aaac4f8dc050 and 30051b9.

📒 Files selected for processing (4)
  • .github/workflows/pr.yml
  • src/renderer/src/components/terminal-pane/terminal-cjk-cursor-cell-placement.test.ts
  • src/renderer/src/components/terminal-pane/terminal-cursor-appearance-precedence.test.ts
  • tests/e2e/terminal-korean-endofrow-preedit-cell-span.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/terminal-pane/terminal-cursor-appearance-precedence.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 2 remain after this review.

Comment on lines +40 to +50
async function sampleOpenComposition(page: Page): Promise<MidlinePreeditOcclusionSample> {
await expect
.poll(
async () => {
const overlay = await samplePreeditOverlay(page)
return overlay.active && overlay.rect.width > 0 && overlay.text === '가'
},
{ message: 'the preedit never reached the overlay at a non-zero size' }
)
.toBe(true)
return sampleMidlinePreeditOcclusion(page)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Capture one validated preedit snapshot.

Lines 44-45 validate one overlay sample. Line 50 reads a separate sample. A repaint can occur between these calls, as the comment in this function states. The assertions can then run against inactive or zero-size geometry.

Capture the overlay state and occlusion measurements in one probe. Retry until that combined sample is valid.

Comment on lines +65 to +72
// 안녕하세요 is ten cells, so the cursor lands at the end of the row with nothing after it —
// the shape #12729 hits, and the one where the overlay carries the preedit alone.
await writeToActiveTerminal(orcaPage, '\x1b[2J\x1b[H안녕하세요')
await setImeComposition(arena.session, '가')

const sample = await sampleOpenComposition(orcaPage)
expect(sample.rowTailFromCursor, 'text still sits after the cursor').toBe('')
expect(sample.cursorColumn, 'the cursor is not at the end of the committed run').toBe(10)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

arena_file='tests/e2e/terminal-ime-pane-arena.ts'

ast-grep outline "$arena_file" --match openTerminalImePaneArena --view expanded

rg -n -C 5 --glob '*.ts' \
  'openTerminalImePaneArena|\.resize\(|\bcols\b|\bcolumns\b' \
  tests/e2e

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- arena ---'
cat -n tests/e2e/terminal-ime-pane-arena.ts | sed -n '1,90p'

printf '%s\n' '--- target test ---'
cat -n tests/e2e/terminal-korean-endofrow-preedit-cell-span.spec.ts | sed -n '1,110p'

printf '%s\n' '--- arena callers and explicit sizing ---'
rg -n -C 3 --glob '*.ts' \
  'openTerminalImePaneArena|terminal\.resize\([^)]*10|resize\(\s*10|cols:\s*10|columns:\s*10' \
  tests/e2e

Repository: stablyai/orca

Length of output: 25745


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import re

arena = Path("tests/e2e/terminal-ime-pane-arena.ts").read_text()
match = re.search(
    r"export async function openTerminalImePaneArena\b.*?(?=\nexport |\Z)",
    arena,
    re.S,
)
if not match:
    raise SystemExit("openTerminalImePaneArena was not found")

body = match.group(0)
print("openTerminalImePaneArena calls terminal.resize:", bool(re.search(r"\bresize\s*\(", body)))
print("openTerminalImePaneArena fixes a ten-column grid:", bool(re.search(r"\b(?:cols|columns)\s*[:=]\s*10\b", body)))

test = Path("tests/e2e/terminal-korean-endofrow-preedit-cell-span.spec.ts").read_text()
print("test writes ten-cell Hangul text:", "안녕하세요" in test)
print("test asserts cursorColumn === 10:", "cursorColumn" in test and ".toBe(10)" in test)
PY

Repository: stablyai/orca

Length of output: 339


Fix the end-of-row setup.

Resize the terminal to 10 columns before writing 안녕하세요. cursorColumn === 10 proves only the committed text length, not that the cursor is in the terminal's last column.

@nwparker
nwparker force-pushed the nwparker/terminal-cjk-preedit-block-tests branch from 30051b9 to 66a1be6 Compare August 18, 2026 09:09
…e cursor

A report described the cursor sitting on a wide character's first cell
and hiding its right half, with cursor style and opacity settings
ignored. Neither defect reproduces.

Replaying the reporter's own captured byte stream leaves the cursor at
column 11, exactly where the application asked, with correct wide and
continuation cells. A block cursor also cannot hide half a glyph: it
inverts the cell and the syllable renders inside the cursor span.

The black block is the IME preedit overlay. macOS 2-set Korean keeps the
trailing syllable composing until a terminator, so it sits in an opaque
absolutely-positioned box over the grid rather than in the buffer. That
box took stock upstream colours, black on white. It explains what no
cursor theory can: the block appears at the composing cursor cell, no
cursor option reaches it, it is identical with GPU acceleration off
since it is a DOM node above both renderers, Latin never triggers it
because Latin opens no composition, and Enter clears it because Enter
commits the composition.

Already fixed by the overlay theming in #15014, which landed a day after
the reported release, so the fix ships in the next one.

Tests only, no production change. Two pin the negative results so the
cursor explanation cannot be re-derived, and one pins the actual
mechanism at end of row, beside the existing mid-line arm.

Separately confirmed and not fixed here: the WebGL renderer drops the
cursor colour's alpha, so terminal cursor opacity genuinely does nothing
for a block cursor, which is the default style on the default renderer.
That is in the webgl addon rather than in xterm or in our code.

Refs #12729
… the overlay

Review of the first pass found one assertion that could not fail. It set
options.cursorStyle and then read decPrivateModes.cursorStyle, which are
separate fields with separate storage, so it pinned that writing one does
not clobber the other. Deleting the precedence expression from both
renderers left it green.

It now asserts the rendered cursor class: the option style renders, a
DECSCUSR overrides it, and the reset hands control back. That fails if
the precedence is removed.

The overlay's rendered width is the one measurement in the report that
argues against our explanation, and no test here could reach it, because
the unit environment performs no layout. Adds an end-of-row browser arm
beside the existing mid-line one, asserting a single composing Hangul
syllable spans about two cells. That settles whether the block the
reporter measured at one cell can be this overlay.

Also scopes two DOM queries to the test container rather than the
document, and attaches the render listener before writing so a missed
render fails instead of hanging to timeout.

Records in the file header what it does not establish: composing the
opacity into the theme is not the same as it reaching the screen, since
the webgl renderer drops the cursor colour's alpha for a block cursor.

Refs #12729
@nwparker
nwparker force-pushed the nwparker/terminal-cjk-preedit-block-tests branch from 66a1be6 to a0dff39 Compare August 18, 2026 09:25
@nwparker
nwparker merged commit 4b2c901 into main Aug 18, 2026
49 checks passed
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…e cursor (stablyai#15242)

* test(terminal): pin that the CJK block is the preedit overlay, not the cursor

A report described the cursor sitting on a wide character's first cell
and hiding its right half, with cursor style and opacity settings
ignored. Neither defect reproduces.

Replaying the reporter's own captured byte stream leaves the cursor at
column 11, exactly where the application asked, with correct wide and
continuation cells. A block cursor also cannot hide half a glyph: it
inverts the cell and the syllable renders inside the cursor span.

The black block is the IME preedit overlay. macOS 2-set Korean keeps the
trailing syllable composing until a terminator, so it sits in an opaque
absolutely-positioned box over the grid rather than in the buffer. That
box took stock upstream colours, black on white. It explains what no
cursor theory can: the block appears at the composing cursor cell, no
cursor option reaches it, it is identical with GPU acceleration off
since it is a DOM node above both renderers, Latin never triggers it
because Latin opens no composition, and Enter clears it because Enter
commits the composition.

Already fixed by the overlay theming in stablyai#15014, which landed a day after
the reported release, so the fix ships in the next one.

Tests only, no production change. Two pin the negative results so the
cursor explanation cannot be re-derived, and one pins the actual
mechanism at end of row, beside the existing mid-line arm.

Separately confirmed and not fixed here: the WebGL renderer drops the
cursor colour's alpha, so terminal cursor opacity genuinely does nothing
for a block cursor, which is the default style on the default renderer.
That is in the webgl addon rather than in xterm or in our code.

Refs stablyai#12729

* test(terminal): make the cursor precedence assertion real and measure the overlay

Review of the first pass found one assertion that could not fail. It set
options.cursorStyle and then read decPrivateModes.cursorStyle, which are
separate fields with separate storage, so it pinned that writing one does
not clobber the other. Deleting the precedence expression from both
renderers left it green.

It now asserts the rendered cursor class: the option style renders, a
DECSCUSR overrides it, and the reset hands control back. That fails if
the precedence is removed.

The overlay's rendered width is the one measurement in the report that
argues against our explanation, and no test here could reach it, because
the unit environment performs no layout. Adds an end-of-row browser arm
beside the existing mid-line one, asserting a single composing Hangul
syllable spans about two cells. That settles whether the block the
reporter measured at one cell can be this overlay.

Also scopes two DOM queries to the test container rather than the
document, and attaches the render listener before writing so a missed
render fails instead of hanging to timeout.

Records in the file header what it does not establish: composing the
opacity into the theme is not the same as it reaching the screen, since
the webgl renderer drops the cursor colour's alpha for a block cursor.

Refs stablyai#12729
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…e cursor (stablyai#15242)

* test(terminal): pin that the CJK block is the preedit overlay, not the cursor

A report described the cursor sitting on a wide character's first cell
and hiding its right half, with cursor style and opacity settings
ignored. Neither defect reproduces.

Replaying the reporter's own captured byte stream leaves the cursor at
column 11, exactly where the application asked, with correct wide and
continuation cells. A block cursor also cannot hide half a glyph: it
inverts the cell and the syllable renders inside the cursor span.

The black block is the IME preedit overlay. macOS 2-set Korean keeps the
trailing syllable composing until a terminator, so it sits in an opaque
absolutely-positioned box over the grid rather than in the buffer. That
box took stock upstream colours, black on white. It explains what no
cursor theory can: the block appears at the composing cursor cell, no
cursor option reaches it, it is identical with GPU acceleration off
since it is a DOM node above both renderers, Latin never triggers it
because Latin opens no composition, and Enter clears it because Enter
commits the composition.

Already fixed by the overlay theming in stablyai#15014, which landed a day after
the reported release, so the fix ships in the next one.

Tests only, no production change. Two pin the negative results so the
cursor explanation cannot be re-derived, and one pins the actual
mechanism at end of row, beside the existing mid-line arm.

Separately confirmed and not fixed here: the WebGL renderer drops the
cursor colour's alpha, so terminal cursor opacity genuinely does nothing
for a block cursor, which is the default style on the default renderer.
That is in the webgl addon rather than in xterm or in our code.

Refs stablyai#12729

* test(terminal): make the cursor precedence assertion real and measure the overlay

Review of the first pass found one assertion that could not fail. It set
options.cursorStyle and then read decPrivateModes.cursorStyle, which are
separate fields with separate storage, so it pinned that writing one does
not clobber the other. Deleting the precedence expression from both
renderers left it green.

It now asserts the rendered cursor class: the option style renders, a
DECSCUSR overrides it, and the reset hands control back. That fails if
the precedence is removed.

The overlay's rendered width is the one measurement in the report that
argues against our explanation, and no test here could reach it, because
the unit environment performs no layout. Adds an end-of-row browser arm
beside the existing mid-line one, asserting a single composing Hangul
syllable spans about two cells. That settles whether the block the
reporter measured at one cell can be this overlay.

Also scopes two DOM queries to the test container rather than the
document, and attaches the render listener before writing so a missed
render fails instead of hanging to timeout.

Records in the file header what it does not establish: composing the
opacity into the theme is not the same as it reaching the screen, since
the webgl renderer drops the cursor colour's alpha for a block cursor.

Refs stablyai#12729
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…e cursor (stablyai#15242)

* test(terminal): pin that the CJK block is the preedit overlay, not the cursor

A report described the cursor sitting on a wide character's first cell
and hiding its right half, with cursor style and opacity settings
ignored. Neither defect reproduces.

Replaying the reporter's own captured byte stream leaves the cursor at
column 11, exactly where the application asked, with correct wide and
continuation cells. A block cursor also cannot hide half a glyph: it
inverts the cell and the syllable renders inside the cursor span.

The black block is the IME preedit overlay. macOS 2-set Korean keeps the
trailing syllable composing until a terminator, so it sits in an opaque
absolutely-positioned box over the grid rather than in the buffer. That
box took stock upstream colours, black on white. It explains what no
cursor theory can: the block appears at the composing cursor cell, no
cursor option reaches it, it is identical with GPU acceleration off
since it is a DOM node above both renderers, Latin never triggers it
because Latin opens no composition, and Enter clears it because Enter
commits the composition.

Already fixed by the overlay theming in stablyai#15014, which landed a day after
the reported release, so the fix ships in the next one.

Tests only, no production change. Two pin the negative results so the
cursor explanation cannot be re-derived, and one pins the actual
mechanism at end of row, beside the existing mid-line arm.

Separately confirmed and not fixed here: the WebGL renderer drops the
cursor colour's alpha, so terminal cursor opacity genuinely does nothing
for a block cursor, which is the default style on the default renderer.
That is in the webgl addon rather than in xterm or in our code.

Refs stablyai#12729

* test(terminal): make the cursor precedence assertion real and measure the overlay

Review of the first pass found one assertion that could not fail. It set
options.cursorStyle and then read decPrivateModes.cursorStyle, which are
separate fields with separate storage, so it pinned that writing one does
not clobber the other. Deleting the precedence expression from both
renderers left it green.

It now asserts the rendered cursor class: the option style renders, a
DECSCUSR overrides it, and the reset hands control back. That fails if
the precedence is removed.

The overlay's rendered width is the one measurement in the report that
argues against our explanation, and no test here could reach it, because
the unit environment performs no layout. Adds an end-of-row browser arm
beside the existing mid-line one, asserting a single composing Hangul
syllable spans about two cells. That settles whether the block the
reporter measured at one cell can be this overlay.

Also scopes two DOM queries to the test container rather than the
document, and attaches the render listener before writing so a missed
render fails instead of hanging to timeout.

Records in the file header what it does not establish: composing the
opacity into the theme is not the same as it reaching the screen, since
the webgl renderer drops the cursor colour's alpha for a block cursor.

Refs stablyai#12729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant