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
9836aebe
Unverified
Commit
9836aebe
authored
Dec 14, 2021
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(agnoster): quote % in prompt functions
parent
3e9fe6e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
agnoster.zsh-theme
themes/agnoster.zsh-theme
+8
-9
No files found.
themes/agnoster.zsh-theme
View file @
9836aebe
...
...
@@ -135,7 +135,7 @@ prompt_git() {
zstyle
':vcs_info:*'
formats
' %u%c'
zstyle
':vcs_info:*'
actionformats
' %u%c'
vcs_info
echo
-n
"
${
ref
/refs\/heads\//
$PL_BRANCH_CHAR
}${
vcs_info_msg_0_
%%
}${
mode
}
"
echo
-n
"
${
${
ref
:gs/%/%%
}
/refs\/heads\//
$PL_BRANCH_CHAR
}${
vcs_info_msg_0_
%%
}${
mode
}
"
fi
}
...
...
@@ -153,7 +153,7 @@ prompt_bzr() {
if
bzr_status
=
$(
bzr status 2>&1
)
;
then
status_mod
=
$(
echo
-n
"
$bzr_status
"
|
head
-n1
|
grep
"modified"
|
wc
-m
)
status_all
=
$(
echo
-n
"
$bzr_status
"
|
head
-n1
|
wc
-m
)
revision
=
$
(
bzr log
-r-1
--log-format
line |
cut
-d
:
-f1
)
revision
=
$
{$(
bzr log
-r-1
--log-format
line |
cut
-d
:
-f1
)
:gs/%/%%
}
if
[[
$status_mod
-gt
0
]]
;
then
prompt_segment yellow black
"bzr@
$revision
✚"
else
...
...
@@ -183,7 +183,7 @@ prompt_hg() {
# if working copy is clean
prompt_segment green
$CURRENT_FG
fi
echo
-n
$
(
hg prompt
"☿ {rev}@{branch}"
)
$st
echo
-n
$
{$(
hg prompt
"☿ {rev}@{branch}"
)
:gs/%/%%
}
$st
else
st
=
""
rev
=
$(
hg
id
-n
2>/dev/null |
sed
's/[^-0-9]//g'
)
...
...
@@ -197,7 +197,7 @@ prompt_hg() {
else
prompt_segment green
$CURRENT_FG
fi
echo
-n
"☿
$
rev
@
$branch
"
$st
echo
-n
"☿
$
{
rev
:gs/%/%%
}
@
${
branch
:gs/%/%%
}
"
$st
fi
fi
}
...
...
@@ -209,9 +209,8 @@ prompt_dir() {
# Virtualenv: current working virtualenv
prompt_virtualenv
()
{
local
virtualenv_path
=
"
$VIRTUAL_ENV
"
if
[[
-n
$virtualenv_path
&&
-n
$VIRTUAL_ENV_DISABLE_PROMPT
]]
;
then
prompt_segment blue black
"(
`
basename
$virtualenv_path
`
)"
if
[[
-n
"
$VIRTUAL_ENV
"
&&
-n
"
$VIRTUAL_ENV_DISABLE_PROMPT
"
]]
;
then
prompt_segment blue black
"(
${
VIRTUAL_ENV
:t:gs/%/%%
}
)"
fi
}
...
...
@@ -237,8 +236,8 @@ prompt_status() {
prompt_aws
()
{
[[
-z
"
$AWS_PROFILE
"
||
"
$SHOW_AWS_PROMPT
"
=
false
]]
&&
return
case
"
$AWS_PROFILE
"
in
*
-prod
|
*
production
*
)
prompt_segment red yellow
"AWS:
$
AWS_PROFILE
"
;;
*
)
prompt_segment green black
"AWS:
$
AWS_PROFILE
"
;;
*
-prod
|
*
production
*
)
prompt_segment red yellow
"AWS:
$
{
AWS_PROFILE
:gs/%/%%
}
"
;;
*
)
prompt_segment green black
"AWS:
$
{
AWS_PROFILE
:gs/%/%%
}
"
;;
esac
}
...
...
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