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

Progress animation is rendered on a new line when the terminal is too small #767

Closed
jooola opened this issue May 28, 2024 · 1 comment · Fixed by #768 or #753
Closed

Progress animation is rendered on a new line when the terminal is too small #767

jooola opened this issue May 28, 2024 · 1 comment · Fixed by #768 or #753
Labels

Comments

@jooola
Copy link
Member

jooola commented May 28, 2024

TL;DR

The progress animation is rendered on a new line if the rendered line is longer than the terminal width.

Expected behavior

The progress animation should not fill the terminal output with new lines, but overwrite the same line with updated values.

$ go run ./cmd/hcloud/main.go server create --name test$RANDOM --type cx11 --image debian-12 --network network
 ✓ Waiting for create_server to complete               100% 16s (server: 47980616)                                                                   
 ✓ Waiting for start_server to complete                100% 16s (server: 47980616)                                                                   
 ✓ Waiting for attach_to_network to complete           100% 16s (server: 47980616, network: 4195679)                                                 
Server 47980616 created

Observed behavior

The terminal output if filled with new lines.

Minimal working example

Reduce the size of your terminal enough to see the behavior occur.

Log output

$ go run ./cmd/hcloud/main.go server create --name test$RANDOM --type cx11 --image debian-12 --network network
 ⠋ Waiting for create_server to complete                 0% 200ms (server: 47980590)
 ⠋ Waiting for start_server to complete                  0% 200ms (ser ⠙ Waiting for create_server to complete                 0% 400ms (server: 47980590) attach_to_network to complete             0% 200ms (ser ⠙ Waiting for start_server to complete                  0% 400ms (ser ⠹ Waiting for create_server to complete                 0% 600ms (server: 47980590) attach_to_network to complete             0% 400ms (ser ⠹ Waiting for start_server to complete                  0% 600ms (ser ⠸ Waiting for create_server to complete                 0% 800ms (server: 47980590) attach_to_network to complete             0% 600ms (ser ⠸ Waiting for start_server to complete                  0% 800ms (ser ⠼ Waiting for create_server to complete                 0% 1.0s (server: 47980590)r attach_to_network to complete             0% 800ms (ser ⠼ Waiting for start_server to complete                  0% 1.0s (serv ⠴ Waiting for create_server to complete                 0% 1.2s (server: 47980590)r attach_to_network to complete             0% 1.0s (serv ⠴ Waiting for start_server to complete                  0% 1.2s (serv ⠦ Waiting for create_server to complete                 0% 1.4s (server: 47980590)r attach_to_network to complete             0% 1.2s (serv ⠦ Waiting for start_server to complete                  0% 1.4s (serv ⠧ Waiting for create_server to complete                 0% 1.6s (server: 47980590)r attach_to_network to complete             0% 1.4s (serv ⠧ Waiting for start_server to complete                  0% 1.6s (serv ⠇ Waiting for create_server to complete                 0% 1.8s (server: 47980590)r attach_to_network to complete             0% 1.6s (serv ⠇ Waiting for start_server to complete                  0% 1.8s (serv ⠏ Waiting for create_server to complete                 0% 2.0s (server: 47980590)r attach_to_network to complete             0% 1.8s (serv ⠏ Waiting for start_server to complete                  0% 2.0s (serv ⠋ Waiting for create_server to complete                 0% 2.2s (server: 47980590)r attach_to_network to complete             0% 2.0s (serv ⠋ Waiting for start_server to complete                  0% 2.2s (serv ⠙ Waiting for create_server to complete                 0% 2.4s (server: 47980590)r attach_to_network to complete             0% 2.2s (serv ⠙ Waiting for start_server to complete                  0% 2.4s (serv ⠹ Waiting for create_server to complete                 0% 2.6s (server: 47980590)r attach_to_network to complete             0% 2.4s (serv ⠹ Waiting for start_server to complete                  0% 2.6s (serv ⠸ Waiting for create_server to complete                 0% 2.8s (server: 47980590)r attach_to_network to complete             0% 2.6s (serv ⠸ Waiting for start_server to complete                  0% 2.8s (serv ⠼ Waiting for create_server to complete                 0% 3.0s (server: 47980590)r attach_to_network to complete             0% 2.8s (serv ⠼ Waiting for start_server to complete                  0% 3.0s (serv ⠴ Waiting for create_server to complete                 0% 3.2s (server: 47980590)r attach_to_network to complete             0% 3.0s (serv ⠴ Waiting for start_server to complete                  0% 3.2s (serv ⠦ Waiting for create_server to complete                 0% 3.4s (server: 47980590)r attach_to_network to complete             0% 3.2s (serv ⠦ Waiting for start_server to complete                  0% 3.4s (serv ⠧ Waiting for create_server to complete                 0% 3.6s (server: 47980590)r attach_to_network to complete             0% 3.4s (serv ⠧ Waiting for start_server to complete                  0% 3.6s (serv ⠇ Waiting for create_server to complete                50% 3.8s (server: 47980590)r attach_to_network to complete             0% 3.6s (serv ⠇ Waiting for start_server to complete                  0% 3.8s (serv ⠏ Waiting for create_server to complete                50% 4.0s (server: 47980590)r attach_to_network to complete             0% 3.8s (serv ⠏ Waiting for start_server to complete                  0% 4.0s (serv ✓ Waiting for create_server to complete               100% 4.2s (server: 47980590)r attach_to_network to complete             0% 4.0s (serv ⠋ Waiting for start_server to complete                  0% 4.2s (serv ✓ Waiting for create_server to complete               100% 4.4s (server: 47980590)r attach_to_network to complete             0% 4.2s (serv ⠙ Waiting for start_server to complete                  0% 4.4s (serv ✓ Waiting for create_server to complete               100% 4.6s (server: 47980590)r attach_to_network to complete             0% 4.4s (serv ⠹ Waiting for start_server to complete                  0% 4.6s (serv ✓ Waiting for create_server to complete               100% 4.8s (server: 47980590)r attach_to_network to complete             0% 4.6s (serv ⠸ Waiting for start_server to complete                  0% 4.8s (serv ✓ Waiting for create_server to complete               100% 5.0s (server: 47980590)r attach_to_network to complete             0% 4.8s (serv ⠼ Waiting for start_server to complete                  0% 5.0s (serv ✓ Waiting for create_server to complete               100% 5.2s (server: 47980590)r attach_to_network to complete             0% 5.0s (serv ⠴ Waiting for start_server to complete                  0% 5.2s (serv ✓ Waiting for create_server to complete               100% 5.4s (server: 47980590)r attach_to_network to complete             0% 5.2s (serv ⠦ Waiting for start_server to complete                  0% 5.4s (serv ✓ Waiting for create_server to complete               100% 5.6s (server: 47980590)r attach_to_network to complete             0% 5.4s (serv ⠧ Waiting for start_server to complete                  0% 5.6s (serv ✓ Waiting for create_server to complete               100% 5.8s (server: 47980590)r attach_to_network to complete             0% 5.6s (serv ⠇ Waiting for start_server to complete                  0% 5.8s (serv ✓ Waiting for create_server to complete               100% 6.0s (server: 47980590)r attach_to_network to complete             0% 5.8s (serv ⠏ Waiting for start_server to complete                  0% 6.0s (serv ✓ Waiting for create_server to complete               100% 6.2s (server: 47980590)r attach_to_network to complete             0% 6.0s (serv ⠋ Waiting for start_server to complete                  0% 6.2s (serv ✓ Waiting for create_server to complete               100% 6.4s (server: 47980590)r attach_to_network to complete             0% 6.2s (serv ⠙ Waiting for start_server to complete                  0% 6.4s (serv ✓ Waiting for create_server to complete               100% 6.6s (server: 47980590)r attach_to_network to complete             0% 6.4s (serv ⠹ Waiting for start_server to complete                  0% 6.6s (serv ✓ Waiting for create_server to complete               100% 6.8s (server: 47980590)r attach_to_network to complete             0% 6.6s (serv ⠸ Waiting for start_server to complete                  0% 6.8s (serv ✓ Waiting for create_server to complete               100% 7.0s (server: 47980590)r attach_to_network to complete           100% 6.8s (serv ⠼ Waiting for start_server to complete                  0% 7.0s (serv ✓ Waiting for create_server to complete               100% 7.2s (server: 47980590)r attach_to_network to complete           100% 7.0s (serv ⠴ Waiting for start_server to complete                  0% 7.2s (serv ✓ Waiting for create_server to complete               100% 7.4s (server: 47980590)r attach_to_network to complete           100% 7.2s (serv ⠦ Waiting for start_server to complete                  0% 7.4s (serv ✓ Waiting for create_server to complete               100% 7.6s (server: 47980590)r attach_to_network to complete           100% 7.4s (serv ⠧ Waiting for start_server to complete                  0% 7.6s (serv ✓ Waiting for create_server to complete               100% 7.9s (server: 47980590)r attach_to_network to complete           100% 7.6s (serv ⠇ Waiting for start_server to complete                  0% 7.9s (serv ✓ Waiting for create_server to complete               100% 8.1s (server: 47980590)r attach_to_network to complete           100% 7.9s (serv ⠏ Waiting for start_server to complete                  0% 8.1s (serv ✓ Waiting for create_server to complete               100% 8.3s (server: 47980590)r attach_to_network to complete           100% 8.1s (serv ⠋ Waiting for start_server to complete                  0% 8.3s (serv ✓ Waiting for create_server to complete               100% 8.5s (server: 47980590)r attach_to_network to complete           100% 8.3s (serv ⠙ Waiting for start_server to complete                  0% 8.5s (serv ✓ Waiting for create_server to complete               100% 8.7s (server: 47980590)r attach_to_network to complete           100% 8.5s (serv ⠹ Waiting for start_server to complete                  0% 8.7s (serv ✓ Waiting for create_server to complete               100% 8.9s (server: 47980590)r attach_to_network to complete           100% 8.7s (serv ⠸ Waiting for start_server to complete                  0% 8.9s (serv ✓ Waiting for create_server to complete               100% 9.1s (server: 47980590)r attach_to_network to complete           100% 8.9s (serv ⠼ Waiting for start_server to complete                  0% 9.1s (serv ✓ Waiting for create_server to complete               100% 9.3s (server: 47980590)r attach_to_network to complete           100% 9.1s (serv ⠴ Waiting for start_server to complete                  0% 9.3s (serv ✓ Waiting for create_server to complete               100% 9.5s (server: 47980590)r attach_to_network to complete           100% 9.3s (serv ⠦ Waiting for start_server to complete                  0% 9.5s (serv ✓ Waiting for create_server to complete               100% 9.7s (server: 47980590)r attach_to_network to complete           100% 9.5s (serv ⠧ Waiting for start_server to complete                  0% 9.7s (serv ✓ Waiting for create_server to complete               100% 9.9s (server: 47980590)r attach_to_network to complete           100% 9.7s (serv ⠇ Waiting for start_server to complete                  0% 9.9s (serv ✓ Waiting for create_server to complete               100% 10s (server: 47980590)or attach_to_network to complete           100% 9.9s (serv ⠏ Waiting for start_server to complete                  0% 10s (serve ✓ Waiting for create_server to complete               100% 10s (server: 47980590)or attach_to_network to complete           100% 10s (serve ⠋ Waiting for start_server to complete                 90% 10s (serve ✓ Waiting for create_server to complete               100% 10s (server: 47980590)or attach_to_network to complete           100% 10s (serve ⠙ Waiting for start_server to complete                 90% 10s (serve ✓ Waiting for create_server to complete               100% 11s (server: 47980590)or attach_to_network to complete           100% 10s (serve ⠹ Waiting for start_server to complete                 90% 11s (serve ✓ Waiting for create_server to complete               100% 11s (server: 47980590)or attach_to_network to complete           100% 11s (serve ⠸ Waiting for start_server to complete                 90% 11s (serve ✓ Waiting for create_server to complete               100% 11s (server: 47980590)or attach_to_network to complete           100% 11s (serve ⠼ Waiting for start_server to complete                 90% 11s (serve ✓ Waiting for create_server to complete               100% 11s (server: 47980590)or attach_to_network to complete           100% 11s (serve ⠴ Waiting for start_server to complete                 90% 11s (serve ✓ Waiting for create_server to complete               100% 11s (server: 47980590)or attach_to_network to complete           100% 11s (serve ⠦ Waiting for start_server to complete                 90% 11s (serve ✓ Waiting for create_server to complete               100% 12s (server: 47980590)or attach_to_network to complete           100% 11s (serve ⠧ Waiting for start_server to complete                 90% 12s (serve ✓ Waiting for create_server to complete               100% 12s (server: 47980590)or attach_to_network to complete           100% 12s (serve ⠇ Waiting for start_server to complete                 90% 12s (serve ✓ Waiting for create_server to complete               100% 12s (server: 47980590)or attach_to_network to complete           100% 12s (serve ⠏ Waiting for start_server to complete                 90% 12s (serve ✓ Waiting for create_server to complete               100% 12s (server: 47980590)or attach_to_network to complete           100% 12s (serve ⠋ Waiting for start_server to complete                 90% 12s (serve ✓ Waiting for create_server to complete               100% 12s (server: 47980590)or attach_to_network to complete           100% 12s (serve ⠙ Waiting for start_server to complete                 90% 12s (serve ✓ Waiting for create_server to complete               100% 13s (server: 47980590)or attach_to_network to complete           100% 12s (serve ⠹ Waiting for start_server to complete                 90% 13s (serve ✓ Waiting for create_server to complete               100% 13s (server: 47980590)or attach_to_network to complete           100% 13s (serve ⠸ Waiting for start_server to complete                 90% 13s (serve ✓ Waiting for create_server to complete               100% 13s (server: 47980590)or attach_to_network to complete           100% 13s (serve ⠼ Waiting for start_server to complete                 90% 13s (serve ✓ Waiting for create_server to complete               100% 13s (server: 47980590)or attach_to_network to complete           100% 13s (serve ⠴ Waiting for start_server to complete                 90% 13s (serve ✓ Waiting for create_server to complete               100% 13s (server: 47980590)or attach_to_network to complete           100% 13s (serve ⠦ Waiting for start_server to complete                 90% 13s (serve ✓ Waiting for create_server to complete               100% 14s (server: 47980590)or attach_to_network to complete           100% 13s (serve ⠧ Waiting for start_server to complete                 90% 14s (serve ✓ Waiting for create_server to complete               100% 14s (server: 47980590)or attach_to_network to complete           100% 14s (serve ⠇ Waiting for start_server to complete                 90% 14s (serve ✓ Waiting for create_server to complete               100% 14s (server: 47980590)or attach_to_network to complete           100% 14s (serve ⠏ Waiting for start_server to complete                 90% 14s (serve ✓ Waiting for create_server to complete               100% 14s (server: 47980590)or attach_to_network to complete           100% 14s (serve ⠋ Waiting for start_server to complete                 90% 14s (serve ✓ Waiting for create_server to complete               100% 14s (server: 47980590)or attach_to_network to complete           100% 14s (serve ✓ Waiting for start_server to complete                100% 14s (server: 47980590)
 ✓ Waiting for attach_to_network to complete           100% 14s (server: 47980590, network: 4195679)
Server 47980590 created

Additional information

We might be facing cheggaaa/pb#171 and cheggaaa/pb#107

@jooola jooola added the bug label May 28, 2024
@jooola
Copy link
Member Author

jooola commented May 28, 2024

We could have different rendering depending on the terminal width. It might not make sens to display the progress if you don't have any space to show it.

jooola added a commit that referenced this issue Jun 5, 2024
- Reduce the width of the actions messages (remove 'to complete')
- Only print progress when the terminal width is bigger than 80.
- Reduce the padding when printing the actions messages

Fixes #767
phm07 pushed a commit that referenced this issue Jun 20, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.44.0](v1.43.1...v1.44.0)
(2024-06-20)


### Features

* delete multiple resources in parallel
([#761](#761))
([f2fb321](f2fb321))
* improve toml formatting
([#758](#758))
([eacb7dd](eacb7dd))
* **load-balancer:** allow specifying health check options in
add-service ([#743](#743))
([2cd08b2](2cd08b2)),
closes [#742](#742)
* new action waiting progress
([#749](#749))
([9e30f3f](9e30f3f))
* new configuration system, config subcommand
([#736](#736))
([d1c6678](d1c6678))
* **server-type:** add deprecated column to list command
([#780](#780))
([906f864](906f864))
* **server:** add default-ssh-keys option
([#759](#759))
([9b34d26](9b34d26))


### Bug Fixes

* **firewall:** 'create --rules-file' not working with outbound rules
([#752](#752))
([2f2be32](2f2be32)),
closes [#750](#750)
* network list server count format
([#783](#783))
([f69d261](f69d261))
* track progress if the terminal width allows it
([#768](#768))
([069fffe](069fffe)),
closes [#767](#767)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant