question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prompt takes ~10 seconds to arrive.

See original GitHub issue

Environment

PS version: 7.1.0
PSReadline version: 2.1.0
os: 10.0.14393.0 (rs1_release.160715-1616)
PS file version: 7.1.0.0
HostName: ConsoleHost
BufferWidth: 120
BufferHeight: 9001

I’m here from https://github.com/PowerShell/PowerShell/issues/14266

The OS is Windows 10, heavily restricted with policies and no internet.

Using pwsh -NonInteractive doesn’t have this problem.

Tell me what I should investiguate, maybe use the latest master? some wireshark trace?

Exception report

No exceptions

Steps to reproduce

Simply run pwsh.

Expected behavior

Almost instant prompt.

Actual behavior

it displays this instantly:

PowerShell 7.1.0
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

Then after ~10 seconds it displays PS C:\Users\foo> and I can enter commands.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
msftrncscommented, Jan 24, 2021

PSReadLine does retrieve a command history file at start up. I find that some of my installations take a while to load this file.

Try the command:

(Get-PSReadLineOption).HistorySavePath

Check out the file it returns, and see if it is really large, or if access to it is very slow, possibly by network redirection.

0reactions
Silexcommented, Mar 2, 2021

Actually -NoProfile is slow as well now.

It’s the default install I don’t have any modules:

PS C:\Users\philippe> pwsh -NoProfile
PowerShell 7.1.2
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.
>>>>>>>>>>>>>>> 10 SECONDS WAIT HERE <<<<<<<<<<<<<<<<
PS C:\Users\philippe> Get-Module

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.1.0                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, …

PS C:\Users\philippe>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does it take tens of seconds to get a shell prompt?
It's a sort of regular occurrence that, after SSHing to a server (or even opening a terminal on my Mac), the login banner...
Read more >
Why does command prompt open up for half a second ...
Basically command prompt just opens for like not even half a second and then closes itself. Should I be worried about this or...
Read more >
Command prompt takes 7-8 seconds to load in Windows 7
When I go to Run and type cmd, it takes about 7-8 seconds for the command prompt to appear. I have a Core...
Read more >
Long Delay for UAC Prompt to Appear?
For me, when I did not provide access to all of the Trusted Roots the UAC prompt took almost 30 seconds to come...
Read more >
Command Prompt randomly opens and closes within ...
Command Prompt randomly opens and closes within seconds. Hey guys, i have bought this new acer laptop only 3 days ago, the computer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found