Skip to content

Powershell intellisense doesn't complete previous multiline commands #4474

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

Open
5 tasks done
jszabo98 opened this issue Feb 10, 2025 · 2 comments
Open
5 tasks done

Powershell intellisense doesn't complete previous multiline commands #4474

jszabo98 opened this issue Feb 10, 2025 · 2 comments
Labels
Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.

Comments

@jszabo98
Copy link

Prerequisites

Steps to reproduce

echo '1
2
3'

echo '      # psreadline doesn't fill in previous command

Expected behavior

# Should fill in previous command.

Actual behavior

# Nothing happens.

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@StevenBucher98
Copy link
Collaborator

This should be in the PSReadLine repo, tagging @daxian-dbw for additional insight but personally I see this to be pretty tricky given a situation where the prompt is at the bottome of the screen do we scroll it up to make room for the new lines? Similiarly we would need to limit the amount of new lines suggested to a certain length because often times folks (myself included) like to copy and paste a large function and would not want to see that suggested to me with predictive intellisense.

@mklement0
Copy link

mklement0 commented Feb 10, 2025

@StevenBucher98, at list in the list view the scrolling problem could be solved by using a single-line representation in the suggestions list, in the simplest case with an ellipsis () indicating the omission of the subsequent lines.
This technique is already used for overly long single-line commands.

As for the default inline view:

  • Note that even an excessively long single-line command can already result in multiple lines being offered as a history completion, due to line wrapping.
  • Similarly, history recall with up-arrow already restores multi-line commands as-is.

Simply omitting multi-line statements from the history, as is currently the case, is definitely suboptimal.

@daxian-dbw daxian-dbw transferred this issue from PowerShell/PowerShell Feb 10, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.
Projects
None yet
Development

No branches or pull requests

3 participants