Skip to content

Cursor positioning after line wrap #1818

@apowers313

Description

@apowers313

When inquirer/prompts line wraps, it seems to frequently mis-position the cursor:
https://vimeo.com/manage/videos/1110980503

I've found that it is consistently replicable if I back-space to the previous line. The mis-positioning seems to be similar to the number of characters used for the ANSI color codes around the '?' at the beginning of the line (but that's just a guess).

I'm curious if anyone else can replicate this problem or if it's just me?

Simple replication code is here:

import { input } from '@inquirer/prompts';

const result = await input({
  message: 'Type a long line that wraps to see cursor bug:',
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions