bun
bun copied to clipboard
Support arrow keys in bun init prompts
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.

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
)
can confirm this is an issue on
- macos 14.4.1 (23E224)
- bun 1.1.8-canary.1+3c082012b
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