simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.67k stars 111 forks source link

`sqlite-utils insert` makes cursor invisible #642

Closed jvns closed 1 week ago

jvns commented 1 week ago

I noticed that the following makes my terminal's cursor become invisible. I'm seeing this in fish, but also in bash/zsh, doesn't seem to be related to my shell.

Here's how to repro:

echo -e "asdf\n2" > test.csv
sqlite-utils insert test.db test --csv test.csv

This is happening because it's printing out the "make cursor invisible" escape code without printing out the corresponding "make cursor visible" escape code (\033[?25h) at the end. Here's the raw output sqlite-utils prints out:

[?25l  [------------------------------------]    0%
[?25l  [#########################-----------]   71%[?25h

[?25l  [####################################]  100%

Feels like it's caused by a weird interaction between sqlite-utils and click.progressbar -- really maybe this should be an issue on click but I wasn't able to figure out what the interaction is between the two libraries is that's causing this.

jvns commented 1 week ago

Never mind! I hadn't tested the latest version, this was just fixed a couple of days ago in 37273d7f63f08872aa1c90c4233a0580e384ac19, also it's a duplicate of #433 :)