aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-21 16:05:26 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-21 16:05:26 +1200
commit2fbbad98b859c052450dc4df40bb336b5896833b (patch)
treed64c10fcf827af97a7f756316e726f0bb49a22cb /bash
parentAdd basic version check to bash_logout (diff)
downloaddotfiles-2fbbad98b859c052450dc4df40bb336b5896833b.tar.gz
dotfiles-2fbbad98b859c052450dc4df40bb336b5896833b.zip
Remove subshell call from status print
Slightly but consistently faster
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/prompt.bash12
1 files changed, 6 insertions, 6 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 12d8ab04..f008cf11 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -103,8 +103,8 @@ prompt() {
fi
# Print the status in brackets with a git: prefix
- printf '(git:%s%s)' \
- "${branch:-unknown}" "$(printf %s "${state[@]}")"
+ local IFS=
+ printf '(git:%s%s)' "${branch:-unknown}" "${state[*]}"
;;
# Mercurial prompt function
@@ -130,8 +130,8 @@ prompt() {
fi
# Print the status in brackets with an hg: prefix
- printf '(hg:%s%s)' \
- "${branch:-unknown}" "$(printf %s "${state[@]}")"
+ local IFS=
+ printf '(hg:%s%s)' "${branch:-unknown}" "${state[*]}"
;;
# Subversion prompt function
@@ -197,8 +197,8 @@ prompt() {
fi
# Print the state in brackets with an svn: prefix
- printf '(svn:%s%s)' \
- "${branch:-unknown}" "$(printf %s "${state[@]}")"
+ local IFS=
+ printf '(svn:%s%s)' "${branch:-unknown}" "${state[*]}"
;;
# VCS wrapper prompt function; print the first relevant prompt, if any