Comments (6)
Very strange.
Can you run this after a new bash and before you did anything manually:
echo $PROMPT_COMMAND
and post the output.
from bash-git-prompt.
Sure:
echo $PROMPT_COMMAND
__vte_prompt_command
from bash-git-prompt.
Ok, this is not correct. Can you
source gitprompt.sh
once manually and let met see what
echo $PROMPT_COMMAND
is then.
from bash-git-prompt.
source ~/.bash-git-prompt/gitprompt.sh
echo $PROMPT_COMMAND
setLastCommandState;__vte_prompt_command;setGitPrompt
I hadn't mentioned yet that sourcing the script manually will also make the prompt appear.
Thank you for your effort.
from bash-git-prompt.
Ok, to me this means that something overwrites the PROMPT_COMMAND
after it is sourced in the .bashrc
with __vte_prompt_command
.
You should narrow down where the PROMPT_COMMAND
gets overwritten. Maybe you do something like this:
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
...
echo "$PROMPT_COMMAND" >> /tmp/debug
fi
in your .bashrc
, open a new terminal and then look what /tmp/debug
contains. That way you can trace down the cause.
from bash-git-prompt.
In my bashrc I had the line
if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END
which I'm not sure what this does and it seem like Ubuntu Budgie automatically added this. But this line was causing PROMPT_COMMAND
to be set to __vte_prompt_command
.
I removed the line, problem solved.
FYI the content of /etc/profile.d/vte.sh
:
# Copyright © 2012 Christian Persch
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Not bash or zsh?
[ -n "${BASH_VERSION:-}" -o -n "${ZSH_VERSION:-}" ] || return 0
# Not an interactive shell?
[[ $- == *i* ]] || return 0
# Not running under vte?
[ "${VTE_VERSION:-0}" -ge 3405 ] || return 0
# TERM not supported?
case "$TERM" in
xterm*|vte*|gnome*) :;;
*) return 0 ;;
esac
__vte_osc7 () {
printf "\033]7;file://%s%s\033\\" "${HOSTNAME}" "$(/usr/libexec/vte-urlencode-cwd)"
}
__vte_prompt_command() {
local pwd='~'
[ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
pwd="${pwd//[[:cntrl:]]}"
printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${pwd}"
__vte_osc7
}
if [[ -n "${BASH_VERSION:-}" ]]; then
# Newer bash versions support PROMPT_COMMAND as an array. In this case
# only add the __vte_osc7 function to it, and leave setting the terminal
# title to the outside setup.
# On older bash, we can only overwrite the whole PROMPT_COMMAND, so must
# use the __vte_prompt_command function which also sets the title.
if [[ "$(declare -p PROMPT_COMMAND 2>&1)" =~ "declare -a" ]]; then
PROMPT_COMMAND+=(__vte_osc7)
else
PROMPT_COMMAND="__vte_prompt_command"
fi
elif [[ -n "${ZSH_VERSION:-}" ]]; then
precmd_functions+=(__vte_osc7)
fi
return 0
from bash-git-prompt.
Related Issues (20)
- Incompatible with exported $CDPATH HOT 2
- Maintenance HOT 4
- readarray: command not found HOT 2
- Discontinuation of the fish-shell features
- Line highlighting: useful when scrolling and I need to find my ex prompts HOT 1
- Superseded? HOT 1
- Looking for maintainers HOT 15
- would love new release versions that we can watch for as changes come out HOT 3
- Sometimes "git pull" errors with "fatal: Cannot rebase onto multiple branches." but is fine immediately afterwards HOT 4
- Solarized_UserHost showing up as 'root@localhost #️ {ResetColor}' and keeping red color HOT 3
- zsh HOT 1
- brew update
- git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
- Unstaged type changes and deletions are misrecognized as staged changes
- Prompt shows "_LAST_COMMAND_INDICATOR_" when leaving git repo HOT 1
- origin/master : nombre entier attendu comme expression HOT 1
- working with multiple remotes HOT 2
- _LAST_COMMAND_INDICATOR_ not replaced when not in a git repo HOT 2
- _LAST_COMMAND_INDICATOR_ on standard user
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bash-git-prompt.