Add behavior for Ctrl + D to activity prompt

Open
#2,073 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

Start by locating the activity-prompt handler and its existing Escape behavior, using #2046 as context. Compare the desired Ctrl+D behavior with the IPython description in this issue, and determine whether console-prompt handling is in scope. Done means the agreed Ctrl+D behavior works in the activity prompt and the relevant behavior is verified.

Written by the indexing model from the issue text.

Description

area: console

In #2046, we made the handling for Escape more consistent between the activity prompt and console prompt, and #1230 is tracking how we can improve the situation for Ctrl+C. However, we currently don't have any handling at all for Ctrl+D. In RStudio, this behaves the same as Enter in an activity prompt i.e. prompts for input again like "Enter an item from the menu, or 0 to exit", much as @seeM describes the IPython behavior:

  • Ctrl+d:
    • In an ordinary python REPL and in pdb and ipdb, it exits without confirmation if the input is empty (otherwise does nothing).
    • In an IPython REPL, it asks for confirmation if the input is empty (otherwise does nothing), and the user can either reply with y + Enter or another Ctrl+d.

I don't think too many people use ordinary Python REPLs (I might be wrong) so I would lean toward IPython where they deviate.

Originally posted by @seeM in https://github.com/posit-dev/positron/issues/1148#issuecomment-1887012916

I'm less sure what we might want Ctrl+D to do in the console prompt; RStudio doesn't do anything there.

Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/positron

All issues in posit-dev/positron

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.