Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did not work with Ubuntu 18.04 #58

Open
iamraju opened this issue May 19, 2018 · 5 comments
Open

Did not work with Ubuntu 18.04 #58

iamraju opened this issue May 19, 2018 · 5 comments

Comments

@iamraju
Copy link

iamraju commented May 19, 2018

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 ?

@joeytwiddle
Copy link

joeytwiddle commented May 21, 2018

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

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

@iamraju
Copy link
Author

iamraju commented May 29, 2018

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

@hossein-jazayeri
Copy link

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.

@carstencodes
Copy link

@hossein-jazayeri @iamraju

Following magicmonty/bash-git-prompt#520 solved this issue for me.

Does this line appear in your .bashrc?

@diogoca
Copy link

diogoca commented Jun 8, 2023

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\]\$ "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants