How do you use the right prompt? #8668
floam
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
I use the right prompt to show the time and git status: I also have different colors for different users (on various different systems). Just a visual clue to where I am / who I am. My prompt is pretty nontrivial, but here's just that portion: # Defined in /fish/git/functions/fish_right_prompt.fish @ line 2
function fish_right_prompt
__ds_powerline_right
end # Defined in /fish/git/conf.d/powerline.fish @ line 172
function __ds_powerline_right
if not set -q __ds_powerline_right_segments[1]
return 0
end
set -l segment
__ds_powerline_setup_vars false
if set -q __ds_powerline_highlight_color[1] && set -q __ds_powerline_drawing_multiline[1]
set __ds_color_normal $__ds_powerline_highlight_color
end
if set -q __ds_powerline_drawing_multiline
echo -n $__ds_powerline_tput_sc$__ds_powerline_tput_cuu1$__ds_powerline_tput_cuf2
end
for segment in $__ds_powerline_right_segments
if test -z $segment; continue; end
set -l seg_func __ds_powerline_{$segment}_draw
if not functions -q $seg_func
__ds_powerline_draw_whole_segment "prompt_error" "$segment not a valid segment"
else
$seg_func 2>/dev/null
end
end
set_color normal
if set -q __ds_powerline_drawing_multiline
echo -n $__ds_powerline_tput_rc
set -e __ds_powerline_drawing_multiline
end
__ds_powerline_teardown_vars
end My prompt isn't actually multiline, the actual prompt is only that second line. The first is output when |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm curious how people have set up their right prompts. I used to report
$CMD_DURATION
. More recently, I've found it useful to keep track of my laptop's battery. It reminds me to plug it in.Beta Was this translation helpful? Give feedback.
All reactions