fish: Remove right prompt. Put vcs info on terminal bottom line.
This commit is contained in:
parent
49bf77b97f
commit
fe829e19c5
1 changed files with 30 additions and 51 deletions
|
@ -94,66 +94,45 @@
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate prompt
|
jj log --ignore-working-copy --no-graph --color never -r @ -T '
|
||||||
jj log --ignore-working-copy --no-graph --color never -r @ -T '
|
surround(
|
||||||
surround(
|
" \e[2;3m",
|
||||||
" \e[2;3m",
|
"\e[0m",
|
||||||
"\e[0m",
|
separate(
|
||||||
separate(
|
" ",
|
||||||
" ",
|
surround(
|
||||||
surround("\e[0;1;95m ", "\e[0;2;3m", change_id.shortest()),
|
"\e[0;2;3m",
|
||||||
surround("\e[0;35m ", "\e[0m", bookmarks.join("╱")),
|
"\e[0m",
|
||||||
surround("\e[0;34m ", "\e[0;2;3m", commit_id.shortest()),
|
coalesce(
|
||||||
if(conflict, ""),
|
surround(
|
||||||
if(empty, ""),
|
"\e[1;2;3m❝",
|
||||||
if(divergent, ""),
|
"❞\e[0m",
|
||||||
if(hidden, ""),
|
if(
|
||||||
)
|
description.first_line().substr(0, 80).starts_with(description.first_line()),
|
||||||
)
|
description.first_line().substr(0, 80),
|
||||||
'
|
description.first_line().substr(0, 79) ++ "…"
|
||||||
'';
|
)
|
||||||
|
),
|
||||||
fish_jj_desc.body = ''
|
"…"
|
||||||
if not command -sq jj || not jj root --quiet &>/dev/null
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
jj log --ignore-working-copy --no-graph --color never -r @ -T '
|
|
||||||
surround(
|
|
||||||
" \e[0;2;3m",
|
|
||||||
"\e[0m",
|
|
||||||
coalesce(
|
|
||||||
surround(
|
|
||||||
"\e[1;2;3m❝",
|
|
||||||
"❞\e[0m",
|
|
||||||
if(
|
|
||||||
description.first_line().substr(0, 80).starts_with(description.first_line()),
|
|
||||||
description.first_line().substr(0, 80),
|
|
||||||
description.first_line().substr(0, 79) ++ "…"
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
"…"
|
|
||||||
),
|
),
|
||||||
|
surround("\e[0;1;95m ", "\e[0;2;3m", change_id.shortest()),
|
||||||
|
surround("\e[0;35m ", "\e[0m", bookmarks.join("╱")),
|
||||||
|
surround("\e[0;34m ", "\e[0;2;3m", commit_id.shortest()),
|
||||||
|
if(conflict, ""),
|
||||||
|
if(empty, ""),
|
||||||
|
if(divergent, ""),
|
||||||
|
if(hidden, ""),
|
||||||
)
|
)
|
||||||
'
|
)
|
||||||
|
'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fish_prompt.body = ''
|
fish_prompt.body = ''
|
||||||
echo -e "\033[1;2;38;5;236m"
|
echo -e "\033[s\033[$LINES;1H\033[1;2;38;5;238m$(string pad -c '┄' -w $COLUMNS (fish_jj_prompt || fish_vcs_prompt))\033[0m\033[u"
|
||||||
string pad -c '┄' -w $COLUMNS (fish_jj_desc)
|
|
||||||
echo -ne "\033[0;3m"
|
|
||||||
string join "" -- (set_color --italics) (prompt_hostname) ':' (prompt_pwd --full-length-dirs=4) (set_color yellow) ' ❯ ' (set_color normal)
|
string join "" -- (set_color --italics) (prompt_hostname) ':' (prompt_pwd --full-length-dirs=4) (set_color yellow) ' ❯ ' (set_color normal)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fish_right_prompt.body = ''
|
|
||||||
if test $CMD_DURATION -gt 3000
|
|
||||||
# Show duration of the last command in seconds
|
|
||||||
set duration (echo "$CMD_DURATION 1000" | awk '{printf "%.1fs", $1 / $2}')
|
|
||||||
echo -n "⏳$duration "
|
|
||||||
end
|
|
||||||
fish_jj_prompt || fish_vcs_prompt
|
|
||||||
'';
|
|
||||||
|
|
||||||
transient_prompt_func.body = ''
|
transient_prompt_func.body = ''
|
||||||
echo
|
echo
|
||||||
string join "" -- (set_color yellow) '❯ ' (set_color normal)
|
string join "" -- (set_color yellow) '❯ ' (set_color normal)
|
||||||
|
|
Loading…
Reference in a new issue