mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Skip evaluating suggestions at startup (#18232)
This commit is contained in:
1 parent
667e75559d
commit
bcde806724
1 file changed
+5
-4
@@ -2465,14 +2465,15 @@ namespace Microsoft.PowerShell
|
||||
/// </summary>
|
||||
internal void Run(bool inputLoopIsNested)
|
||||
{
|
||||
System.Management.Automation.Host.PSHostUserInterface c = _parent.UI;
|
||||
PSHostUserInterface c = _parent.UI;
|
||||
ConsoleHostUserInterface ui = c as ConsoleHostUserInterface;
|
||||
|
||||
Dbg.Assert(ui != null, "Host.UI should return an instance.");
|
||||
|
||||
bool inBlockMode = false;
|
||||
bool previousResponseWasEmpty = false;
|
||||
StringBuilder inputBlock = new StringBuilder();
|
||||
// Use nullable so that we don't evaluate suggestions at startup.
|
||||
bool? previousResponseWasEmpty = null;
|
||||
var inputBlock = new StringBuilder();
|
||||
|
||||
while (!_parent.ShouldEndSession && !_shouldExit)
|
||||
{
|
||||
@@ -2499,7 +2500,7 @@ namespace Microsoft.PowerShell
|
||||
ui.WriteLine();
|
||||
|
||||
// Evaluate any suggestions
|
||||
if (!previousResponseWasEmpty)
|
||||
if (previousResponseWasEmpty == false)
|
||||
{
|
||||
EvaluateSuggestions(ui);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user