Skip to content

Cursor does not point appropriate position when using Japanese in LineEditor.ReadLine #12

Description

@itn3000

Overview

When input Japanese string in LineEditor.ReadLine, unexpected behavior on cursor position and output.

Environment

version: 0.10.0
platform: windows-11x64
dotnet-sdk: 10.0.203
terminal: windows terminal with powershell-7.6.0, vscode terminal with powershell-7.6.0

Steps to reproduce

  1. write following code(file based app)
  2. run code by dotnet run test.cs
  3. input Japanese string(like あいうえお), copy and paste is also OK
#:package RadLine@0.10.0

using RadLine;

var editor = new LineEditor();
var l = await editor.ReadLine(default);

Console.WriteLine(l);

Expected

rendered あいうえお after prompt and cursor is placed end of line, like following

> あいうえお_ # '_' is cursor positoin

Actual

rendered as following

> あい                                                                                                                                                 
> あいう                                                                                                                                               
> あいうえ                                                                                                                                             
> あいうえお                                                                                                                                           
> あいうえお
     _ # '_' is cursor position

Additional Info

I tested on AnsiConsole.AskAsync<string> in Spectre.Console-0.55.2, work as I expected

Activity

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

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