Added a segment that shows the current GO version number.
This commit is contained in:
parent
6cec4ce400
commit
1a5edebae7
2 changed files with 11 additions and 0 deletions
|
@ -608,6 +608,16 @@ prompt_dir() {
|
|||
"$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON')$current_path"
|
||||
}
|
||||
|
||||
# GO-prompt
|
||||
prompt_go_version() {
|
||||
local go_version
|
||||
go_version=$(go version 2>&1 | grep -oe "^go[0-9.]*")
|
||||
|
||||
if [[ -n "$go_version" ]]; then
|
||||
"$1_prompt_segment" "$0" "green" "255" "$go_version"
|
||||
fi
|
||||
}
|
||||
|
||||
# Command number (in local history)
|
||||
prompt_history() {
|
||||
"$1_prompt_segment" "$0" "244" "$DEFAULT_COLOR" '%h'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue