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

Fix UI panic and login errors on mintty/Windows #1561

Merged
merged 4 commits into from
Jul 17, 2020
Merged

Conversation

imiric
Copy link
Contributor

@imiric imiric commented Jul 16, 2020

Closes #1559

Confirmed working on the latest Git Bash (2.27.0) and mintty 3.1.6 on Windows 10 x64 1903.

The "error getting terminal size" warning will still be shown and the progressbars will be static, but at least it doesn't panic 😅

@imiric imiric requested review from mstoykov and na-- July 16, 2020 07:48
cmd/ui.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2020

Codecov Report

Merging #1561 into master will decrease coverage by 0.09%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1561      +/-   ##
==========================================
- Coverage   77.18%   77.09%   -0.10%     
==========================================
  Files         162      162              
  Lines       13172    13188      +16     
==========================================
  Hits        10167    10167              
- Misses       2485     2501      +16     
  Partials      520      520              
Impacted Files Coverage Δ
cmd/login_cloud.go 8.77% <0.00%> (-0.49%) ⬇️
cmd/login_influxdb.go 3.57% <0.00%> (-0.21%) ⬇️
cmd/ui.go 24.85% <0.00%> (-1.03%) ⬇️
ui/form_fields.go 47.82% <0.00%> (-3.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62e1b53...7aa5269. Read the comment docs.

if !errTermGetSize {
// More responsive progress bar resizing on platforms with SIGWINCH (*nix)
termWidth, _, err = terminal.GetSize(fd)
if err != nil {
Copy link
Contributor Author

@imiric imiric Jul 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can ignore checking this err if it didn't fail the first time?

cmd/ui.go Show resolved Hide resolved
This falls back to plain text input which will echo the password back,
but there doesn't seem to be a way around that. :-/
@imiric imiric force-pushed the fix/1559-mintty-panic branch from 7f6a17a to 1e4b958 Compare July 16, 2020 11:49
@imiric imiric requested review from mstoykov and na-- July 16, 2020 11:53
@imiric imiric changed the title Fix UI panic on mintty/Windows Fix UI panic and login errors on mintty/Windows Jul 16, 2020
Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@imiric imiric merged commit 9c8de85 into master Jul 17, 2020
@imiric imiric deleted the fix/1559-mintty-panic branch July 17, 2020 08:06
@na-- na-- added this to the v0.27.1 milestone Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: integer divide by zero
4 participants