Feature Request: Create a `EndOfLineOrAcceptSuggestion function` for `Ctrl+e` binding

Open
#4,929 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
cli

Research direction

No source file or test is named. Start by locating the existing EndOfLine and AcceptSuggestion handlers and their tests, then add the combined Ctrl+e behavior described in the issue. Done means the cursor moves to the line end when it is not there and accepts the inline suggestion when it is already there, with tests covering both cases.

Written by the indexing model from the issue text.

Description

Issue-Enhancement Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
Description of the new feature/enhancement

Many users, especially those with Emacs muscle memory, expect Ctrl+e to move the cursor to the end of the line (the EndOfLine function).

With the introduction of predictions, many of these same users want to bind Ctrl+e to also accept the full inline suggestion, similar to how RightArrow works.

The current, discoverable way to do this is:

Set-PSReadLineKeyHandler -Chord 'Ctrl+e' -Function AcceptSuggestion

However, this binding completely overrides the original EndOfLine behavior. This forces the user to choose between one function or the other, which is a poor experience.

Proposed technical implementation details (optional)

I propose adding a new, built-in PSReadLine function (e.g., EndOfLineOrAcceptSuggestion) that intelligently combines both behaviors.

The logic for this new function would be:

  1. If the cursor is not at the end of the line, perform the EndOfLine action.
  2. If the cursor is already at the end of the line, perform the AcceptSuggestion action.

This would create a "smart" key binding that "does the right thing" based on context.

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

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 PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.