mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 05:59:46 +08:00
Compare commits
3 Commits
1b5503a3ee
...
67581c53c6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67581c53c6 | ||
|
|
0c80a063c3 | ||
|
|
f78c6b90fc |
@ -124,7 +124,7 @@ function _omz_async_callback() {
|
|||||||
|
|
||||||
# Repaint prompt if output has changed
|
# Repaint prompt if output has changed
|
||||||
if [[ "$old_output" != "${_OMZ_ASYNC_OUTPUT[$handler]}" ]]; then
|
if [[ "$old_output" != "${_OMZ_ASYNC_OUTPUT[$handler]}" ]]; then
|
||||||
zle reset-prompt
|
zle .reset-prompt
|
||||||
zle -R
|
zle -R
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
16
lib/git.zsh
16
lib/git.zsh
@ -39,21 +39,17 @@ function _omz_git_prompt_info() {
|
|||||||
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use async version if setting is enabled, or undefined but zsh version is at least 5.0.6
|
# Use async version if setting is enabled or undefined
|
||||||
# https://github.com/ohmyzsh/ohmyzsh/issues/12331#issuecomment-2059460268
|
if zstyle -T ':omz:alpha:lib:git' async-prompt; then
|
||||||
if zstyle -t ':omz:alpha:lib:git' async-prompt \
|
|
||||||
|| { is-at-least 5.0.6 && zstyle -T ':omz:alpha:lib:git' async-prompt }; then
|
|
||||||
function git_prompt_info() {
|
function git_prompt_info() {
|
||||||
setopt localoptions noksharrays
|
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}" ]]; then
|
||||||
if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]" ]]; then
|
echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}"
|
||||||
echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function git_prompt_status() {
|
function git_prompt_status() {
|
||||||
setopt localoptions noksharrays
|
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}" ]]; then
|
||||||
if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then
|
echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}"
|
||||||
echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ function _add_identities() {
|
|||||||
# if id is an absolute path, make file equal to id
|
# if id is an absolute path, make file equal to id
|
||||||
[[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id"
|
[[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id"
|
||||||
# check for filename match, otherwise try for signature match
|
# check for filename match, otherwise try for signature match
|
||||||
if [[ ${loaded_ids[(I)$file]} -le 0 ]]; then
|
if [[ -f $file && ${loaded_ids[(I)$file]} -le 0 ]]; then
|
||||||
sig="$(ssh-keygen -lf "$file" | awk '{print $2}')"
|
sig="$(ssh-keygen -lf "$file" | awk '{print $2}')"
|
||||||
[[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file")
|
[[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file")
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user