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

Aperta
#4,929 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C#
Stelle
4.4k
Fork
341
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PSReadLine

Tutte le issue di PowerShell/PSReadLine

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.