Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading a small file causes an error in the progress bar function #3923

Closed
thorstenkampe opened this issue Apr 9, 2020 · 3 comments
Closed
Labels

Comments

@thorstenkampe
Copy link

thorstenkampe commented Apr 9, 2020

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.

@grrttedwards
Copy link

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

@r15ch13
Copy link
Member

r15ch13 commented Apr 19, 2020

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
}

@r15ch13 r15ch13 added the bug label Apr 19, 2020
@r15ch13 r15ch13 changed the title error when installing via ssh Downloading a small file causes an error in the progress bar function Apr 19, 2020
@grrttedwards
Copy link

Awesome, thank you. @r15ch13
Also tagging #3891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants