posit-dev / posit-dev/positron
Cancel multiline input with `Esc` at console
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
Multiline input at the console cannot be cancelled with Esc but only ctrl+c:
I realise this design was decided at #2905. The discussion there noted people might be asking in the future, and this seems about the time people start asking ;)
There might be three things here (where 2 and 3 might be the same technically?):
- Use
Escto clear a one-line input. - Use
Escto interrupt a process. - Use
Escto exit a multiline input.
For 1, I agree with the original discussion that there are better ways like select all and delete.
What I really want to use Esc for are 2 and 3.
For 2, once I start a process I would be unlikely to type anything in the console anymore to avoid cancelling anything (unless I do want to cancel the process). A muscle memory even from RStudio. If I am going to type something it will be in a script. The rare cases where I do type something in the console are when the process is fast so the risk is small. However I do see how this is still debatable.
For 3, I don't usually type anything across multiple lines in the console intentionally. Most often it is because I am missing a closing bracket somewhere and the console starts to wait for me to close it. And it is in this case that I use Esc most often. It is just natural to reach Esc when the console hangs. It would take me some while to adjust if this feature is gone forever.
I understand the intention is to make Esc a safe key to close pop-ups with completions, etc, but that seems like a separate issue to me. That issue is about completions popping up too often/inappropriately, so, in my opinion, the solution should be adjusting the behaviour of completions, and shouldn't be sacrificing Esc. It is still a big issue to me that I am closing autocompletion more often than I actually adopt the completion, and this is not solved by just having a safe key. (I have my share of complaints about autocompletions in #4442.)
I think it would be great if we could have the option to choose if Esc behave the same way as
Escin RStudio, or- current
ctrl+cin Positron.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issue #2905 and compare its decision with the three Esc behaviors described here. Reproduce the current multiline-console behavior, then determine which cancellation behavior is intended and verify that Esc still handles completion pop-ups appropriately; done means the chosen behavior works without regressing those interactions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100