Open hwooo opened 3 years ago
mycli is using python-prompt-toolkit to handle console input/output. Starting from v3.0.14, python-prompt-toolkit lets you disable bell using an environment variable PROMPT_TOOLKIT_BELL=false
:
Give it a try and let us know if this helps.
Do I have to install python-prompt-toolkit separately? or can I configure it in .myclirc file?
If you have mycli installed, you already have prompt-toolkit installed. Mycli would not work without it.
python -m pip freeze
would show you all installed python modules and their versions.
I can't find proper solution without rebuilding mycli :(
I guess I should have asked how you installed mycli in the first place. It was not pip install mycli
?
No, I intalled mycli with pip.
So what does pip freeze | grep prompt-toolkit
tell you?
In PowerShell, pip freeze | findstr prompt-toolkit
gives me following results:
prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1602688806899/work
I see. Not very helpful. How about this?
$ python
>>> import prompt_toolkit
>>> prompt_toolkit.__version__
'3.0.8'
If you have 3.0.14 or above, running mycli like this should work:
PROMPT_TOOLKIT_BELL=false mycli
If you have something lower, you can upgrade prompt-toolkit with:
pip install -U prompt-toolkit
alternatively, you could upgrade mycli and all related packages with:
pip install -U mycli
see if this helps.
❯ PROMPT_TOOLKIT_BELL=false mycli
PROMPT_TOOLKIT_BELL=false : The term 'PROMPT_TOOLKIT_BELL=false' is not recognized as the name of a cmdlet, function,
script file, or operable program.
I have prompt_toolkit
of version 3.0.16, but the command PROMPT_TOOLKIT_BELL=false mycli
doesn't seem to work on Windows. I just turned off entire alert in Control center :(
You're right, Windows / PowerShell has different syntax. It would be something like this:
> $env:PROMPT_TOOLKIT_BELL = 'false'
> mycli
I'm on a Mac, so I'm flying blind here, sorry.
It's okay. But $env:PROMPT_TOOLKIT_BELL = 'false'
also doesn't work. 😂
I see. I should give up on trying to fix a Windows problem! @dbcli/mycli-core are any of you able to try this on Windows?
I'm using mycli on Windows Terminal. I disabled bell sound in the terminal so there is no beep on cmd, ps, and original MySQL cli.
But there is still a beep sound inside mycli. Is there any option to disable bell inside of mycli?