Merge pull request #43738 from azat/client/fix-prompt

This commit is contained in:
Vladimir C 2022-11-28 11:52:16 +01:00 committed by GitHub
commit a3276005c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,18 +15,26 @@
</openSSL> </openSSL>
<!-- <!--
It's a custom prompt settings for the clickhouse-client It's a custom prompt settings for the clickhouse-client
Possible macros: Possible macros:
{host} {host}
{port} {port}
{user} {user}
{display_name} {display_name}
Terminal colors: https://misc.flogisoft.com/bash/tip_colors_and_formatting
See also: https://wiki.hackzine.org/development/misc/readline-color-prompt.html You can also use colored prompt, like in [1].
[1]: https://misc.flogisoft.com/bash/tip_colors_and_formatting
But note, that ClickHouse does not use readline anymore, instead it uses
replxx. This means that you don't need the following:
- RL_PROMPT_START_IGNORE (\001)
- RL_PROMPT_END_IGNORE (\002)
--> -->
<prompt_by_server_display_name> <prompt_by_server_display_name>
<default>{display_name} :) </default> <default>{display_name} :) </default>
<test>{display_name} \x01\e[1;32m\x02:)\x01\e[0m\x02 </test> <!-- if it matched to the substring "test" in the server display name - --> <test>{display_name} \e[1;32m:)\e[0m </test> <!-- if it matched to the substring "test" in the server display name - -->
<production>{display_name} \x01\e[1;31m\x02:)\x01\e[0m\x02 </production> <!-- if it matched to the substring "production" in the server display name --> <production>{display_name} \e[1;31m:)\e[0m </production> <!-- if it matched to the substring "production" in the server display name -->
</prompt_by_server_display_name> </prompt_by_server_display_name>
<!-- <!--