YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

color ydb_prompt #348

Closed pkoper closed 5 years ago

pkoper commented 5 years ago

GT.M allows ANSI escape codes in gtm_prompt which are very useful for having dev prompts in green, production prompts in red, test prompts in yellow and so on:

image

Looks like support for ANSI escape codes in YottaDB's ydb script is broken for gtm_prompt environment variable and not allowed for ydb_prompt environment variable:

image

When mumps -direct is used:

image

The expected result is to have printed to the terminal any binary content of gtm_prompt or ydb_prompt in the same way as PS1 environment variable in Bash (or gtm_prompt in GT.M).

pkoper commented 5 years ago

gtmprofile from GT.M expands escape sequences in "\e[1;32mDEV\e[m GTM>" into binary form and gtmprofile form YottaDB does not. It's ok, one can put into ydb_prompt already expanded escape sequences using "echo -e".

YottaDB mumps binary is ok, looks like the problem is with the ydb script (please mind the -e switch for echo):

image

Narrowing problem even more it is something with shell expansion:

image

nars1 commented 5 years ago

This issue is already fixed, for a different reason, by https://gitlab.com/YottaDB/DB/YDB/issues/309 in the upcoming YottaDB release r1.24. We will update the final release note in that link to indicate your symptom too as being fixed. You should be able to build from the latest code and verify your use case works fine. If not, let us know.