Running Start-PSBootstrap changes console defaults in conhost · Issue #27978 · PowerShell/PowerShell · GitHub
Skip to content

Running Start-PSBootstrap changes console defaults in conhost #27978

Description

@kilasuit

Prerequisites

Steps to reproduce

When trying to do a local build in a PowerShell 7.6.5 session after running

Import-Module .\build.psm1

Whilst running Start-PSBootstrap -Scenario All -Force it gets into the Install-DotNet function and during this it ends up changing the console font & size as shown below, which is a jarring and unwanted experience.

It seems to b connected to the use of calling out to PowerShell.exe & Start-NativeExecution form initial stepping through the code

PowerShell/build.psm1

Lines 2807 to 2838 in b664c2e

Note: this does not occur in WinTerminal & is only seems to be in conhost (I've not tested elsewhere)

Also, annoyingly this doesn't happen every time I attempt a build either & this is the 2nd time I've dug into it for this to resolve whilst creating this issue.

Raising for awareness as it's unlikely this will be fixed with it being in conhost only & not being easily repeatable either.

Expected behavior

Console doesn't change unnecessarily

Actual behavior

Fonts change & other unwanted behaviours

Error details

N/A

Environment data

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

Visuals

This is how it comes out (with my profile)
Image

Image

When the defaults are

Image Image

Activity

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-BugIssue has been identified as a bug in the productWG-Maintainers-Buildspecific to affecting the build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions