Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
43be5ea3
Unverified
Commit
43be5ea3
authored
3 years ago
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(bureau): quote % in git prompt function and remove global variables
parent
4e777ef9
master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
bureau.zsh-theme
themes/bureau.zsh-theme
+17
-12
No files found.
themes/bureau.zsh-theme
View file @
43be5ea3
...
...
@@ -17,13 +17,14 @@ ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[yellow]%}●%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}"
bureau_git_branch () {
local ref
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
echo "${ref#refs/heads/}"
}
bureau_git_status() {
_STATUS=""
local _STATUS _INDEX
# check status of files
_INDEX=$(command git status --porcelain 2> /dev/null)
...
...
@@ -63,18 +64,22 @@ bureau_git_status() {
echo $_STATUS
}
bureau_git_prompt () {
local _branch=$(bureau_git_branch)
local _status=$(bureau_git_status)
local _result=""
if [[ "${_branch}x" != "x" ]]; then
_result="$ZSH_THEME_GIT_PROMPT_PREFIX$_branch"
if [[ "${_status}x" != "x" ]]; then
_result="$_result $_status"
fi
_result="$_result$ZSH_THEME_GIT_PROMPT_SUFFIX"
bureau_git_prompt() {
local branch=$(bureau_git_branch)
local status=$(bureau_git_status)
local info
if [[ -z "${branch}" ]]; then
return
fi
info="${branch:gs/%/%%}"
if [[ -n "${status}" ]]; then
info+=" $status"
fi
echo $_result
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${info}${ZSH_THEME_GIT_PROMPT_SUFFIX}"
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment