[windows]: Any Theme with Git-Bash is causing an overlap of text
While using GitBash 2.50.windows.1, any theme when used is causing a overlap of text character.
The issue most likely be for messing up the PS1 variable but these are default themes like font, agnoster etc.
When setting the theme="" then overlap issue doesn't seem to work.
This overlap mainly happens when scrolling through history of commands using the up arrow
Any help as I'm not able to find any similar issue and has been facing this problem for quite some time
Terminal: Windows Terminal latest Windows: Windows 11 font: Jetbrains Mono NL
This typically happens when the character width schemes assumed by Bash and the terminal differ. In particular, it is likely that emojis or ambiguous-width characters are related. Which terminal do you use? I checked the behavior in my environment with the default terminal (mintty) of Git Bash, but the problem doesn't reproduce.
This typically happens when the character width schemes assumed by Bash and the terminal differ. In particular, it is likely that emojis or ambiguous-width characters are related. Which terminal do you use? I checked the behavior in my environment with the default terminal (mintty) of Git Bash, but the problem doesn't reproduce.
Yeah I assumed that as well but I'm unable to fix it. Its happening in all my terminals. Current one is Windows Terminal Latest as per the SS. But I tried in Tabby, Vscode as well, Even in Warp.
Then, it might be on Bash's side. Bash uses Readline for line editing, and I think Readline uses the system's wcwidth, which is affected by the current locale. What is your current locale?
$ locale
This was the output when trying the above command
ayanb@IN-9NOMWL4:~/Developer$ locale
LANG=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=
Thank you for the information. Mine is this:
$ locale
LANG=
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=
I tried changing all locale categories to be C.UTF-8, but the problem still doesn't reproduce in my environment with mintty. I also tried Windows Terminal, but the problem still doesn't seem to reproduce.
I also downloaded and installed "JetBrains Mono NL" and specified it in the Windows Terminal settings, but the problem still doesn't reproduce.
I'll think about other possibilities later. Do you have any other special settings in your ~/.bashrc?
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;
*) return;;
esac
# Path to your oh-my-bash installation.
export OSH='/c/Users/ayanb/.oh-my-bash'
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-bash is loaded.
OSH_THEME="emperor"
# If you set OSH_THEME to "random", you can ignore themes you don't like.
# OMB_THEME_RANDOM_IGNORED=("powerbash10k" "wanelo")
# You can also specify the list from which a theme is randomly selected:
# OMB_THEME_RANDOM_CANDIDATES=("font" "powerline-light" "minimal")
# Uncomment the following line to use case-sensitive completion.
# OMB_CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# OMB_HYPHEN_SENSITIVE="false"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_OSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you don't want the repository to be considered dirty
# if there are untracked files.
# SCM_GIT_DISABLE_UNTRACKED_DIRTY="true"
# Uncomment the following line if you want to completely ignore the presence
# of untracked files in the repository.
# SCM_GIT_IGNORE_UNTRACKED="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output. One of the following values can
# be used to specify the timestamp format.
# * 'mm/dd/yyyy' # mm/dd/yyyy + time
# * 'dd.mm.yyyy' # dd.mm.yyyy + time
# * 'yyyy-mm-dd' # yyyy-mm-dd + time
# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors
# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors
# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors
# If not set, the default value is 'yyyy-mm-dd'.
# HIST_STAMPS='yyyy-mm-dd'
# Uncomment the following line if you do not want OMB to overwrite the existing
# aliases by the default OMB aliases defined in lib/*.sh
# OMB_DEFAULT_ALIASES="check"
# Would you like to use another custom folder than $OSH/custom?
# OSH_CUSTOM=/path/to/new-custom-folder
# To disable the uses of "sudo" by oh-my-bash, please set "false" to
# this variable. The default behavior for the empty value is "true".
OMB_USE_SUDO=true
# To enable/disable display of Python virtualenv and condaenv
# OMB_PROMPT_SHOW_PYTHON_VENV=true # enable
# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable
# To enable/disable Spack environment information
# OMB_PROMPT_SHOW_SPACK_ENV=true # enable
# OMB_PROMPT_SHOW_SPACK_ENV=false # disable
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
# Example format: completions=(ssh git bundler gem pip pip3)
# Add wisely, as too many completions slow down shell startup.
completions=(
git
#composer
ssh
#go
#awscli
#nvm
#npm
pip
#pip3
)
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/
# Example format: aliases=(vagrant composer git-avh)
# Add wisely, as too many aliases slow down shell startup.
aliases=(
general
)
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
#bashmarks
#golang
#npm
#nvm
#progress
pyenv
#goenv
#zoxide
)
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format:
# if [ "$DISPLAY" ] || [ "$SSH" ]; then
# plugins+=(tmux-autoattach)
# fi
# If you want to reduce the initialization cost of the "tput" command to
# initialize color escape sequences, you can uncomment the following setting.
# This disables the use of the "tput" command, and the escape sequences are
# initialized to be the ANSI version:
#
#OMB_TERM_USE_TPUT=no
source "$OSH"/oh-my-bash.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-bash libs,
# plugins, and themes. Aliases can be placed here, though oh-my-bash
# users are encouraged to define aliases within the OSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias bashconfig="mate ~/.bashrc"
# alias ohmybash="mate ~/.oh-my-bash"
#export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\w\$ "
# FZF Installation
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# adding local binaries to PATH
export PATH=$PATH:/c/Users/ayanb/.local/bin
# Zoxide Jumper initiation
eval "$(zoxide init bash)"
This is my .bashrc File.
Also point of observation. Setting the LANG to en_GB.utf-8 seemed to be working, but if it's not set for you and it's still working for you then there must be some other bug. Can you tell me how the LANG is being set in your case?
OK, thank you for the information. In my case, LANG is unset by default.
$ declare -p LANG
bash: declare: LANG: not found
In my environment, the problem doesn't reproduce regardless of whether LANG is unset or set to ja_JP.UTF-8 or en_GB.UTF-8. Maybe another possibility could be the language of the Windows system. I'm using Windows with the Japanese language. The base system of Git Bash is based on MSYS2, and MSYS2 is a fork of Cygwin. In the past, I faced with a strange behavior in Cygwin, which only happened under the Windows systems with specific languages. I think the problem at that time was unrelated to the present problem, but I think it suggests a possibility that other behaviors of the MSYS2 system may depend on the language of the Windows system.