Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fichiers_configuration
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Membres actifs
fichiers_configuration
Commits
4d6fe84d
Commit
4d6fe84d
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
le prompt bash custom prend en compte les VENV
parent
7af06e6b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.bashrc
+9
-2
9 additions, 2 deletions
.bashrc
with
9 additions
and
2 deletions
.bashrc
+
9
−
2
View file @
4d6fe84d
...
...
@@ -533,7 +533,14 @@ function prompt_command
DIR
=
$pwd
POST_DIR
=
'${MINUS_LINE:'
${#
pwd
}
+
${
VCS_size
}
+1
'+${#?}}'
fi
# Est-on dans un environement virtuel ?
if
[[
$VIRTUAL_ENV
!=
""
]]
then
VENV
=
"(
${
VIRTUAL_ENV
##*/
}
)"
else
VENV
=
''
fi
# Génération des différents morceaux du prompt, avec ou sans la couleur
if
[
"
$color_prompt
"
=
yes
]
;
then
DIR
=
"<
${
pwd_color
}
"
$DIR
"
${
line_color_prompt
}
>"
...
...
@@ -546,7 +553,7 @@ function prompt_command
DATE
=
"(
${
date_color
}
\D
{%H:%M:%S}
${
line_color_prompt
}
)"
# Deuxième ligne du prompt "user@host $"
# Attention "\\\$" devient \$, c'est-à-dire # pour root, $ pour les autres
PROMPT
=
"
${
username_color
}
\u
${
symbols_color
}
@
${
host_color
}
\h
${
symbols_color
}
\\\$
${
nocolor_prompt
}
"
PROMPT
=
"
${
username_color
}
\u
${
symbols_color
}
@
${
host_color
}
\h
${
symbols_color
}${
VENV
}
${
symbols_color
}
\\\$
${
nocolor_prompt
}
"
# On fusionne tout ça
PS1
=
$TITLE
${
line_color_prompt
}
$MINUS_CHAR$DATE$MINUS_CHAR$DIR$MINUS_CHAR
${
line_color_prompt
}
$POST_DIR$VCS_info$ERR
'\n'
$PROMPT
else
...
...
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