Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AcceptSuggestion also built-in to EndOfLine #3741

Closed
terlar opened this issue Jul 7, 2023 · 6 comments
Closed

AcceptSuggestion also built-in to EndOfLine #3741

terlar opened this issue Jul 7, 2023 · 6 comments
Labels
Issue-Enhancement It's a feature request. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@terlar
Copy link

terlar commented Jul 7, 2023

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.

@terlar terlar added the Issue-Enhancement It's a feature request. label Jul 7, 2023
@StevenBucher98
Copy link
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

@andyleejordan andyleejordan transferred this issue from PowerShell/PowerShell Jul 10, 2023
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jul 10, 2023
@StevenBucher98 StevenBucher98 added Needs-Author Feedback and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Jul 10, 2023
@microsoft-github-policy-service
Copy link
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.

1 similar comment
@microsoft-github-policy-service
Copy link
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.

@daxian-dbw
Copy link
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.

@terlar
Copy link
Author

terlar commented Jul 24, 2023

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.

@daxian-dbw
Copy link
Member

Close as a duplicate of #3705

@daxian-dbw daxian-dbw added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement It's a feature request. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants