Closed linwaytin closed 2 months ago
$ declare -p TERM COLORFGRG _ble_term_TERM # in light-background terminal
$ declare -p TERM COLORFGRG _ble_term_TERM # in dark-background terminal
Here are rough explanations of possible solutions depending on the result of the above command:
TERM
or COLORFGBG
, you can switch the values in _ble_contrib_config_github265_pwd_gspecs
based on the environment variable TERM
or COLORFGBG
._ble_term_TERM
, you can update the values of _ble_contrib_config_github265_pwd_gspecs
when _ble_term_TERM
is updated. This can be done through blehook term_DA2R
. In this case, the values of _ble_contrib_config_github265_pwd_gspecs
can dynamically change, one also needs to add ble/prompt/unit/add-hash '${_ble_contrib_config_github265_pwd_gspecs[*]}'
in the function ble/prompt/backslash:linwaytin/pwd
._ble_contrib_config_github265_pwd_gspecs
. If you use SSH to log in a remote server, you may additionally need to configure both ssh
and sshd
to pass over the environment variable.References:
A1: For light background (emacs-vterm)
declare -x TERM="xterm-256color"
bash: declare: COLORFGRG: not found
declare -a _ble_term_TERM=([0]="xterm:100")
For dark background (xterm)
declare -x TERM="xterm-256color"
bash: declare: COLORFGRG: not found
declare -a _ble_term_TERM=([0]="xterm:393")
But I think your last suggestion is the best solution. Setting up an env variable to determine if it's light background or not is the simplest way.
Another related issue for light background is the selection of suggestions. In dark background, the selected item has inverted color. But for light background, nothing happens and I cannot know which one is the current selection.
Do you have any idea about this behavior?
Thank you.
EDIT: Please skip this post. I found the problem is from my config, which prevented vterm
to invert colors, so it has nothing to do with ble.sh
. My bad.
EDIT:
OK, is there still anything that I can help with?
No, thanks a lot!
Hi, this issue is about the question I asked in https://github.com/akinomyoga/ble.sh/issues/265. Thanks a lot for the solution you provided. I still use it.
Lately I got a problem. Sometimes I have a terminal with a light background color like white. In this case, the foreground colors should not be light. Is it possible to detect the terminal's background color and change the foreground colors used in the gradient PS1?
Thank you.