Skip to content

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

Closed

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 Bruce Payette (@BrucePay)

Activity

  1. changed the title [-]Progress bar with user inputs, verbose or write-output sometimes interference each other[/-] [+]Progress bar with user inputs, verbose or write-output sometimes interfered each other[/+] on May 15, 2018
  2. jianyunt commented on Jun 4, 2018

    @jianyunt
    ContributorAuthor

    Bruce Payette (@BrucePay) I no longer can repro after applied your fix for the particular repro case:

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

    But the gaps issue still exist which may or may not related to the write-progress. I will try to investigate it.
    After the Azure drive appears, get <tab> which will start showing progress bar. After that, a big space gap appears. This issue is manifested in the PSReadline 2.0 beta version only.

    image

  3. added a commit that references this issue on Jun 7, 2018
  4. ocitrev commented on Jul 27, 2022

    @ocitrev

    This happens not only on Linux
    Easy to repro on Windows:

    0..100 | %{ Write-Progress 'Wait' -Percent ($_); sleep -ms 10; if ($_ -eq 42) { cmd /c help } }
  5. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  6. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  7. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  8. added
    Resolution-No Activity
    on Nov 16, 2023
  9. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

  10. added a commit that references this issue on Aug 6, 2026
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

    Resolution-No ActivityWG-Interactive-Console

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions