Skip to content

Progress bar with user inputs, verbose or write-output sometimes interfered each other #6880

@jianyunt

Description

@jianyunt

Try the following sample, press any key, let's say aaaaaaaa, you will see the progress bar moves to right while you are typing. This happens on Linux or Azure cloudshell.

1..100 | foreach{write-progress -id 1 -activity foobar -status busy -percentcomplete $_; sleep 1}

should we turn off echo (stty -echo) before executing the cmdlet and turn it back on after completing the execution?

Steps to reproduce

Run the above sample on Linux
or
In Azure cloudshell bash + pwsh
Get-AzureRMWebApp and then press any key

Expected behavior

User inputs or write-output should not interference with progress bar position.

Actual behavior

The progress bar position changes based on user input. It impacts the verbose message start position too while running install-module.

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.2
PSEdition                      Core
GitCommitId                    v6.0.2
OS                             Linux 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

cc @BrucePay

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions