Anna-Team / AnnaDB

Developer-first database
Apache License 2.0
56 stars 4 forks source link

Python Client Does not clear screen in Windows cmd #6

Open amaster507 opened 1 year ago

amaster507 commented 1 year ago

image

See screenshot above for example. I am Windows based, so this may or may not be specific to windows, idk.

The problem just progresses, if I enter another query and double return to send, then I get this same screen but now my cursor is on top of an existing line of text with more text below it, but that text is background and not editable. Not very user friendly and very hard to read.

roman-right commented 1 year ago

Oh wow! Thank you for the catch. It looks like yes, this is specific to Windows. I'm working on it.

I don't have a Windows machine. Don't you mind if I'll ask you to check the results?

amaster507 commented 1 year ago

Sure, what do you want me to test?

roman-right commented 1 year ago

Could you please check, if removing this line:

https://github.com/roman-right/AnnaDB/blob/main/drivers/python/annadb/shell/__init__.py#L52

will make the process better?

It will not clear the screen but should stop rendering over the previous text.

amaster507 commented 1 year ago

@roman-right that does work,

Or I also tested that adding these two lines also work cleanly and keeps the console tidy.

import os
os.system('cls' if os.name == 'nt' else 'clear')
amaster507 commented 1 year ago

https://stackoverflow.com/a/2084628/1707323

roman-right commented 1 year ago

Nice! I'll check the rich doc to prove, that it doesn't break anything internal there and will add this as a fix today. Thank you!

roman-right commented 1 year ago

Fixed in 0.1.1. Could you please try?