Skip to content

fix(stdio): fix CJK input/deletion glitches by unifying prompt with rustyline #388

@Jiafei-Queen

Description

@Jiafei-Queen

Problem

Currently, stdio.prompt (implemented via dialoguer) has issues handling CJK characters. When a user enters Chinese characters and tries to backspace, it causes byte-offset mismatches, leading to "ghost characters" or incorrect cursor positioning in the terminal.

Background

I noticed that Lune's REPL already uses rustyline for a superior interactive experience. However, the lune-std-stdio crate still relies on dialoguer for its Text prompt, creating a functional inconsistency between the REPL and script-driven prompts.

Proposed Change

I have implemented a local fix by swapping the PromptKind::Text branch in lune-std-stdio to use rustyline.

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