Finally simplified the build_prompt and fixed git status bugginess.
This commit is contained in:
@@ -86,12 +86,19 @@ _adlee_format_user_host() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Format current directory with git info
|
# Format current directory with git info
|
||||||
|
#_adlee_format_directory() {
|
||||||
|
# local short_path="$(_adlee_get_short_path)"
|
||||||
|
# local git_info='$(git_prompt_info)'"${COLOR_GREY}"
|
||||||
|
# echo "${short_path}${git_info}"
|
||||||
|
#}
|
||||||
|
|
||||||
_adlee_format_directory() {
|
_adlee_format_directory() {
|
||||||
local short_path="$(_adlee_get_short_path)"
|
local short_path="$(_adlee_get_short_path)"
|
||||||
local git_info='$(git_prompt_info)'"${COLOR_GREY}"
|
# Remove the single quotes so it gets evaluated in the prompt
|
||||||
echo "${short_path}${git_info}"
|
echo "${short_path}\$(git_prompt_info)${COLOR_GREY}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# COMMAND TIMER FUNCTIONS
|
# COMMAND TIMER FUNCTIONS
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
@@ -123,17 +130,23 @@ _adlee_format_elapsed_time() {
|
|||||||
# PROMPT BUILDING
|
# PROMPT BUILDING
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
|
#_adlee_build_prompt() {
|
||||||
|
# local user_host="$(_adlee_format_user_host)"
|
||||||
|
# local directory="$(_adlee_format_directory)"
|
||||||
|
#
|
||||||
|
# # Build top line: ┌[user@host]─[directory]
|
||||||
|
# local top_line="${COLOR_GREY}┌[${user_host}]─[${directory}]"
|
||||||
|
#
|
||||||
|
# print -P "${top_line}"
|
||||||
|
#
|
||||||
|
# # Set bottom line prompt character
|
||||||
|
# PROMPT="$(_adlee_get_prompt_char)"
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
|
||||||
_adlee_build_prompt() {
|
_adlee_build_prompt() {
|
||||||
local user_host="$(_adlee_format_user_host)"
|
PROMPT="${COLOR_GREY}┌[${COLOR_GREEN}%n@%m${COLOR_RESET}${COLOR_GREY}]─[${COLOR_YELLOW}%~${COLOR_RESET}${COLOR_GREY}\$(git_prompt_info)${COLOR_GREY}]
|
||||||
local directory="$(_adlee_format_directory)"
|
${COLOR_GREY}└${COLOR_BOLD}${COLOR_BLUE}%#${COLOR_RESET} "
|
||||||
|
|
||||||
# Build top line: ┌[user@host]─[directory]
|
|
||||||
local top_line="${COLOR_GREY}┌[${user_host}]─[${directory}]"
|
|
||||||
|
|
||||||
print -P "${top_line}"
|
|
||||||
|
|
||||||
# Set bottom line prompt character
|
|
||||||
PROMPT="$(_adlee_get_prompt_char)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user