summaryrefslogtreecommitdiffstats
path: root/functions/fish_right_prompt.fish
blob: 635a3897629f8e21737cd6e709a0166e210f3c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function cstar_segment_divide_right
  set -l from_var "cstar_$argv[1]"
  set -l from_name "$from_var""_bg"
  set -l from $$from_name
  set -l to_var "cstar_$argv[2]"
  set -l to_name "$to_var""_bg"
  set -l to $$to_name

  if test -z "$$from_var"
    return
  end
  if test -z "$$to_var"
    set -f to normal
  end
  echo (set_color -b $to $from)\uE0B2(set_color normal)
end

function fish_right_prompt --description "The right side of the C-Star prompt"
  echo -e "$(cstar_segment_divide_right command_time normal)$cstar_command_time$(cstar_segment_divide_right datetime command_time)$cstar_datetime"
end