Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

fix(tui): load koffi via createRequire in ESM#1627

Merged
badlogic merged 1 commit intobadlogic:mainfrom
kaste:windows-vt-fix
Feb 25, 2026
Merged

fix(tui): load koffi via createRequire in ESM#1627
badlogic merged 1 commit intobadlogic:mainfrom
kaste:windows-vt-fix

Conversation

@kaste
Copy link
Contributor

@kaste kaste commented Feb 25, 2026

The previous lazy-loading change switched to require("koffi") inside enableWindowsVTInput(). In ESM, require is undefined, so the call threw and VT input mode was silently not enabled on Windows.

Use createRequire(import.meta.url) at module scope and cjsRequire("koffi") at the call site. This keeps koffi externalized for Bun binaries while restoring Windows VT input behavior, including multiline paste handling.

The previous lazy-loading change switched to require("koffi") inside
enableWindowsVTInput(). In ESM, require is undefined, so the call
threw and VT input mode was silently not enabled on Windows.

Use createRequire(import.meta.url) at module scope and
cjsRequire("koffi") at the call site. This keeps koffi externalized
for Bun binaries while restoring Windows VT input behavior, including
multiline paste handling.
@github-actions
Copy link
Contributor

Hi @kaste, thanks for your interest in contributing!

We ask new contributors to open an issue first before submitting a PR. This helps us discuss the approach and avoid wasted effort.

Next steps:

  1. Open an issue describing what you want to change and why (keep it concise, write in your human voice, AI slop will be closed)
  2. Once a maintainer approves with lgtm, you'll be added to the approved contributors list
  3. Then you can submit your PR

This PR will be closed automatically. See https://github.com/badlogic/pi-mono/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions bot closed this Feb 25, 2026
@badlogic badlogic reopened this Feb 25, 2026
@badlogic badlogic merged commit f129ac9 into badlogic:main Feb 25, 2026
1 check passed
@kaste
Copy link
Contributor Author

kaste commented Feb 25, 2026

Issues sind grad zu.

Without the fix ctrl+v for pasting multiple lines is broken on Windows Terminal.

@kaste kaste deleted the windows-vt-fix branch February 25, 2026 11:06
@badlogic
Copy link
Owner

cheers!

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.

2 participants