Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement editing for the Ask function. #161

Open
bsutton opened this issue Sep 22, 2021 · 0 comments
Open

Implement editing for the Ask function. #161

bsutton opened this issue Sep 22, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bsutton
Copy link
Collaborator

bsutton commented Sep 22, 2021

We regularly get requests to support editing when a user is entering input into the ask function.

It would be great if we could support the following edit functions in the Ask prompt

cursor left/right
del key
backspace (already supported on most terminals).

These functions are likely to only work when the terminal supports ansi escape sequences.

As such we need to work out what to do when an ansi terminal isn't available (presumable drop back to the current support of just backspace).

We currently use the dart_console package for handling a no. of the terminal functions. It would be my preference that we keep using this package.

Dart also sometimes incorrectly reports whether we have an ansi terminal. Do we need a method to force ansi support even when Dart doesn't detect it?

Scenarios that I would like to see supported is using ask in:

  • a docker terminal (e.g. you connect to a docker cli and then run a dart script).
  • an ssh session

We have also had a report that the backspace character doesn't work on some mac terminals. This may be because we are using linemode when reading from stdin. This issue may also fix that problem.

@bsutton bsutton added the help wanted Extra attention is needed label Sep 22, 2021
@bsutton bsutton added the enhancement New feature or request label Nov 10, 2021
bsutton added a commit that referenced this issue May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant