AcceptSuggestion also built-in to EndOfLine · Issue #3741 · PowerShell/PSReadLine · GitHub
Skip to content

AcceptSuggestion also built-in to EndOfLine #3741

Closed

Description

@terlar

Summary of the new feature / enhancement

As a user I want to accept the proposed suggestion when going to the end of line

Proposed technical implementation details (optional)

Just like AcceptSuggestion is built-in to ForwardChar I would propose it would be handled the same way for EndOfLine.

Activity

  1. StevenBucher98 commented on Jul 10, 2023

    @StevenBucher98
    Collaborator

    Just so I understand correctly, are you suggesting having AcceptSuggestion be also triggered when you hit the End Key? If so you can bind AcceptSuggestion to End key to get this behavior.
    Set-PSReadLineKeyHandler -Chord Enter -Function ValidateAndAcceptLine

  2. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Jul 10, 2023
  3. microsoft-github-policy-service commented on Jul 17, 2023

    @microsoft-github-policy-service
    Contributor

    This issue is closed because it has been marked as requiring author feedback but has not had any activity for 7 days. If you think the issue is still relevant, please reopen and provide your feedback.

  4. microsoft-github-policy-service commented on Jul 17, 2023

    @microsoft-github-policy-service
    Contributor

    This issue is closed because it has been marked as requiring author feedback but has not had any activity for 7 days. If you think the issue is still relevant, please reopen and provide your feedback.

  5. daxian-dbw commented on Jul 17, 2023

    @daxian-dbw
    Member

    I believe the ask is to make End key complete the suggestion in addition to its current behavior -- when the cursor is not at the end of the current text, End moves the cursor to the end of the text; when the cursor is at the end, End accepts the current inline suggestion.

  6. terlar commented on Jul 24, 2023

    @terlar
    Author

    Sorry, I completely missed that this ticket had replies and then I was travelling.

    Yes, that interpretation is correct, basically how we have this same behavior for ForwardChar and many other operations to move forward.

    I do already have a workaround:

    Set-PSReadLineKeyHandler -Chord 'Ctrl+e' -ScriptBlock {
      [Microsoft.PowerShell.PSConsoleReadLine]::AcceptSuggestion()
      [Microsoft.PowerShell.PSConsoleReadLine]::EndOfLine()
    }

    However, I do think it should be the default behavior, hence me opening this issue.

  7. daxian-dbw commented on Jul 24, 2023

    @daxian-dbw
    Member

    Close as a duplicate of #3705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementIt's a feature request.Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions