Skip to content

fix(v0.2.1): writeTerm this-binding (Critical — v0.2.0 load crash)#2

Merged
rz1989s merged 1 commit into
mainfrom
fix/write-term-this-binding
Jul 20, 2026
Merged

fix(v0.2.1): writeTerm this-binding (Critical — v0.2.0 load crash)#2
rz1989s merged 1 commit into
mainfrom
fix/write-term-this-binding

Conversation

@rz1989s

@rz1989s rz1989s commented Jul 20, 2026

Copy link
Copy Markdown
Member

v0.2.0 regression: writeTerm detached terminal.write from its Terminal instance → this=undefined → Terminal.write reads this.writeLogPath → throws on every load (updateConfig→applyCursorMode→writeTerm during setCustomEditorComponent). Broke the extension for all v0.2.0 users on reload/start.

Fix: call write as a method (t.terminal.write(seq)) so this=Terminal. Regression test uses a regular function reading this (mirrors real Terminal.write); verified red (6 fails) on buggy version, green on fix. 122/122 pass. Bump 0.2.0→0.2.1.

…ding)

v0.2.0 regression: writeTerm did (t.terminal.write ?? t.write)?.(seq) which
detaches the write fn from its Terminal instance → this=undefined in ESM strict
mode → Terminal.write reads this.writeLogPath → throws 'Cannot read properties of
undefined'. Broke the extension on every load (updateConfig→applyCursorMode→
writeTerm throws during setCustomEditorComponent).

Fix: call as a method (t.terminal.write(seq)) so this=Terminal. Added a
regression test using a regular function (not arrow) reading this.writes —
mirrors the real Terminal.write this-dependence; verified red (6 fails) on the
buggy version, green on the fix.
@rz1989s
rz1989s merged commit 366cf43 into main Jul 20, 2026
1 check passed
@rz1989s
rz1989s deleted the fix/write-term-this-binding branch July 20, 2026 10:38
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