Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible_lza_install_common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
ansible_lza_install_common
Commits
c6b1301d
Commit
c6b1301d
authored
3 years ago
by
Jörg Sachse
Browse files
Options
Downloads
Patches
Plain Diff
feat: show Python virtualenv if one is activated
parent
0c07f91d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
files/etc/bash.promptrc
+7
-0
7 additions, 0 deletions
files/etc/bash.promptrc
with
7 additions
and
0 deletions
files/etc/bash.promptrc
+
7
−
0
View file @
c6b1301d
...
@@ -67,8 +67,15 @@ function __prompt_command() {
...
@@ -67,8 +67,15 @@ function __prompt_command() {
PS1="[${RC_GREEN}${CURR_EXIT}${DEFAULT_FOREGROUND}]" # displays green exit status if everything went well
PS1="[${RC_GREEN}${CURR_EXIT}${DEFAULT_FOREGROUND}]" # displays green exit status if everything went well
fi
fi
# find out if we're inside of a virtualenv
local VENV_STRING=""
if [[ -n ${VIRTUAL_ENV} ]]; then
VENV_STRING="[$( basename ${VIRTUAL_ENV} )]"
fi
# final Bash prompt assembly
# final Bash prompt assembly
PS1="${PS1}${BACKGROUND}${USERAT}${PATH_GREEN}[\w]\[$(tput sgr0)\]"
PS1="${PS1}${BACKGROUND}${USERAT}${PATH_GREEN}[\w]\[$(tput sgr0)\]"
PS1="${PS1}${VENV_STRING}"
PS1="${PS1}${USERHASH} "
PS1="${PS1}${USERHASH} "
# add Git branch to PS1 if CWD is a Git Repo
# add Git branch to PS1 if CWD is a Git Repo
#source /usr/lib/git-core/git-sh-prompt
#source /usr/lib/git-core/git-sh-prompt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment