bun icon indicating copy to clipboard operation
bun copied to clipboard

Support arrow keys in bun init prompts

Open JacksonKearl opened this issue 2 years ago • 1 comments

What is the problem this feature would solve?

Currently, attempting to use arrow keys to navigate around text entered in bun init prompts results in ^[[D^[[D^[[D^[[A^[[B^[[B^[[B^[[A^[[A^[[B^[[A^[f^[b^[f^[f^[f-type feedback, rather than cursor navigation.

image

What is the feature you are proposing to solve the problem?

Some sort of support for readline-style navigation.

What alternatives have you considered?

The with-readline wrapper package works well enough (with-readline bun init)

JacksonKearl avatar Dec 27 '22 19:12 JacksonKearl

can confirm this is an issue on

  • macos 14.4.1 (23E224)
  • bun 1.1.8-canary.1+3c082012b

birkskyum avatar May 08 '24 10:05 birkskyum

This is also an issue in for await (const line of console)

  • Left/Right arrow should natively move the cursor (but instead prints ^[[D/^[[C)

  • Up/Down arrow could have a configurable option to change current input based on command history(command history can be either native or implemented by user) (but instead prints ^[[A/^[[B)

tested on Windows 10 + Bun v1.1.11

Araxeus avatar Jun 11 '24 07:06 Araxeus