tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
215 stars 35 forks source link

`turso db create` progress meter "crawls" up the terminal window when its width is narrow #104

Closed CodingDoug closed 1 year ago

CodingDoug commented 1 year ago

For me, using iTerm on Macos, when the window sets the width of the terminal to a certain width in chars (tput cols), the progress meter for database creation crawls up the terminal window, 1 line with each step of the animation, erasing prior lines. The width at which things get weird seems to be based on the width of the line with the meter. For example, with region ord and database name of a single char, this behavior starts at exactly 96 chars or less. Increasing the length of the database name by 1 char raises the limit to 97. However, the length of the line does not actually have to exceed the available space in the window.

Perhaps putting the meter on its own line is an easy fix to allow for sane output on reasonably sized terminals.

haaawk commented 1 year ago

db replicate has the same problem and spinner in db destroy causes the same effect

haaawk commented 1 year ago

spinner in db destroy has even worse effect

haaawk commented 1 year ago

Putting the meter on a separate file does not seem to help much.

haaawk commented 1 year ago

The behaviour is better for db create but becomes worse for db replicate

haaawk commented 1 year ago

Ok it seems that putting the meter on the first line and text below it works for all the 3 commands.