dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.06k stars 67 forks source link

use \033 in prompt #135

Closed one-pyy closed 2 years ago

one-pyy commented 2 years ago

In mycli: image In litecli: image

amjith commented 2 years ago

@one-pyy If you're feeling generous this could be an opportunity to contribute some code and make litecli feature compatible with mycli.

Looks like you just need to run the prompt string through the ANSI() function that comes built in with prompt-toolkit.

Here's how this is implemented in mycli: https://github.com/dbcli/mycli/blob/main/mycli/main.py#L617

You might want to open a PR for litecli that implements this feature. :)

one-pyy commented 2 years ago

Thank you very much for your reply

one-pyy commented 2 years ago

I'm very sorry, I tried to change the source code, then it reported an error and I couldn't find a way to fix it. So I may not be able to contribute some code (ノへ ̄、)

amjith commented 2 years ago

@one-pyy Can you try out the branch that has this feature implemented?

You can install from the branch using the following command:

pip install -U https://github.com/dbcli/litecli/archive/refs/heads/ansi-support.zip
one-pyy commented 2 years ago

image Thank you very much for your help, it works! ♪(・ω・)