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

Đang mở
#4,929 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C#
Star
4.4k
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/PSReadLine

Tất cả issue của PowerShell/PSReadLine

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.