Skip to content

REPL/node:readline: text insertion or paste at non-end cursor position results in scrambled character order #60624

@mandel59

Description

@mandel59

Version

v24.11.0

Platform

Darwin mba-mandel59.local 25.0.0 Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:39 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8103 arm64

Subsystem

REPL, node:readline

What steps will reproduce the bug?

  1. Launch Node.js REPL by running node.

  2. Type two single quotes: ''

  3. Press the Left Arrow once — now the cursor (caret) is between the quotes.

  4. Switch your input method to Japanese IME (Input Method Editor).

  5. Type using Roman letters (ai or aiu) which will be converted by the IME into Japanese Hiragana characters:

    • Typing ai produces the composition string あい

    • Typing aiu produces あいう

  6. Press Return to confirm the IME composition.

How often does it reproduce? Is there a required condition?

Always reproducible (100%)

What is the expected behavior? Why is that the expected behavior?

  • When typing ai → the line should show 'あい'

  • When typing aiu → the line should show 'あいう'

What do you see instead?

  • When typing ai → the line becomes ''いあ

  • When typing aiu → the line becomes ''あうい

The composed text appears in an incorrect order and is placed after the closing quote.

Additional information

  • Occurs both in the REPL and in a standalone readline interface.
  • The regression likely appeared between v24.8.0 and v24.9.0 — possibly related to readline changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions