Scoop: Downloading a small file causes an error in the progress bar function

Created on 9 Apr 2020  路  3Comments  路  Source: lukesampson/scoop

Ssh to to Windows 2019 server core from Windows 10 with KiTTY (a popular PuTTY clone):

> scoop install python
Installing 'python' (3.8.2) [64bit]
install-pep-514.reg (555 B) [=================================================================================================================] 100%
Checking hash of install-pep-514.reg ... ok.

uninstall-pep-514.reg (86 B) [>                                                                                                               ]   0%
The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was 43.
URL https://raw.githubusercontent.com/ScoopInstaller/Main/master/scripts/python/uninstall-pep-514.reg is not valid

Installing via RDP works fine. All components current versions. Using PowerShell Desktop 5.1 .17763 .1007 on server.

bug

Most helpful comment

This is caused by the small filesize of uninstall-pep-514.reg and the progress bar function.
As a workaround, you could install aria2 to bypass scoops progress bar. (scoop install aria2)


The bug is caused by setting the top cursor position to an invalid location.
https://github.com/lukesampson/scoop/blob/a9fa775d59b14e7dce335313faa0eff855469764/lib/install.ps1#L471

It could be fixed by either removing the + 1 part or checking the value and resetting it.

$top = $top + 1
if($top -gt $console.CursorPosition.Y) {
    $top = $console.CursorPosition.Y
}

All 3 comments

I am experiencing this but on a fresh install of Windows 10, directly in a local powershell 7 console.

PS C:\Users\Garrett> scoop install python
Installing 'python' (3.8.2) [64bit]
Loading install-pep-514.reg from cache
Checking hash of install-pep-514.reg ... ok.

uninstall-pep-514.reg (86 B) [>                                                                                                           ]   0%
The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was 43.
URL https://raw.githubusercontent.com/ScoopInstaller/Main/master/scripts/python/uninstall-pep-514.reg is not valid

This is caused by the small filesize of uninstall-pep-514.reg and the progress bar function.
As a workaround, you could install aria2 to bypass scoops progress bar. (scoop install aria2)


The bug is caused by setting the top cursor position to an invalid location.
https://github.com/lukesampson/scoop/blob/a9fa775d59b14e7dce335313faa0eff855469764/lib/install.ps1#L471

It could be fixed by either removing the + 1 part or checking the value and resetting it.

$top = $top + 1
if($top -gt $console.CursorPosition.Y) {
    $top = $console.CursorPosition.Y
}

Awesome, thank you. @r15ch13
Also tagging #3891

Was this page helpful?
0 / 5 - 0 ratings

Related issues

klauern picture klauern  路  3Comments

notlmn picture notlmn  路  3Comments

bernstein82 picture bernstein82  路  3Comments

borekb picture borekb  路  3Comments

nitrocode picture nitrocode  路  3Comments