-
Notifications
You must be signed in to change notification settings - Fork 131
/
_pure_prompt_first_line.fish
41 lines (36 loc) · 1.44 KB
/
_pure_prompt_first_line.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
set --global FAILURE 1
function _pure_prompt_first_line \
--description 'Print contextual information before prompt.'
if not type -q --no-functions git # exit if git is not available
return $FAILURE
end
set --local prompt_ssh (_pure_prompt_ssh)
set --local prompt_container (_pure_prompt_container)
set --local prompt_git (_pure_prompt_git)
set --local prompt_command_duration (_pure_prompt_command_duration)
set --local prompt (_pure_print_prompt \
$prompt_ssh \
$prompt_container \
$prompt_git \
$prompt_command_duration
)
set --local prompt_width (_pure_string_width $prompt)
set --local current_folder (_pure_prompt_current_folder $prompt_width)
set --local prompt_components
if set --query pure_begin_prompt_with_current_directory; and test "$pure_begin_prompt_with_current_directory" = true
set prompt_components \
$current_folder \
$prompt_git \
$prompt_ssh \
$prompt_container \
$prompt_command_duration
else
set prompt_components \
$prompt_ssh \
$prompt_container \
$current_folder \
$prompt_git \
$prompt_command_duration
end
echo (_pure_print_prompt $prompt_components)
end