git-aware-prompt icon indicating copy to clipboard operation
git-aware-prompt copied to clipboard

Did not work with Ubuntu 18.04

Open iamraju opened this issue 6 years ago • 5 comments

Hi There,

While it is/was working with other Debian, it did not work with Ubuntu 18.04. Is there anything that I should take care of ?

iamraju avatar May 19 '18 07:05 iamraju

If you have .bash_profile file, make sure that it sources .profile

Otherwise .profile won't get loaded! (Thanks bash)

joeytwiddle avatar May 21 '18 03:05 joeytwiddle

Nope, I do not have .bash_profile file, but still it does not work.

iamraju avatar May 29 '18 00:05 iamraju

I have the same problem. On the fresh ubuntu 18.04, it doesn't work unless I run the source "${GITAWAREPROMPT}/main.sh" manually. On my previous setup which was 16.04 upgraded to 18.04, it was working though.

hossein-jazayeri avatar Oct 22 '18 11:10 hossein-jazayeri

@hossein-jazayeri @iamraju

Following https://github.com/magicmonty/bash-git-prompt/issues/520 solved this issue for me.

Does this line appear in your .bashrc?

carstencodes avatar Dec 09 '22 20:12 carstencodes

Same issue on Ubuntu Terminal, any idea?

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy

$ echo $BASH
/usr/bin/bash

$ echo $PROMPT_COMMAND
find_git_branch; find_git_dirty; find_git_branch; find_git_dirty;

$ echo $PS1
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[\]$git_branch\[\]$git_dirty\[\]$

$ cat .profile 
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Last lines from my .bashrc:

# enable gitaware 
# https://github.com/jimeh/git-aware-prompt
export GITAWAREPROMPT=~/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"
export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "

diogoca avatar Jun 08 '23 15:06 diogoca