Overview
Comment: | Add Fossil branch to fish prompt
Also prefer Git over Fossil branch instead of showing both in zsh. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
aed8907a52752d059bf1a32e455b8dae |
User & Date: | js 2020-05-24 20:51:51 |
Context
2020-05-25
| ||
20:32 | fish_prompt: Redirect fossil's stderr to /dev/null check-in: 46ef6bc803 user: js tags: trunk | |
2020-05-24
| ||
20:51 | Add Fossil branch to fish prompt check-in: aed8907a52 user: js tags: trunk | |
17:30 | Add flc as alias for "fossil changes --differ" check-in: 4ca56c47e1 user: js tags: trunk | |
Changes
Changes to fish/functions/fish_prompt.fish.
1 2 3 4 5 6 7 8 9 10 11 12 | function fish_prompt --description 'Write out the prompt' set -l suffix switch "$USER" case root toor set suffix (set_color $fish_color_cwd_root)'#' case '*' set suffix '>' end set -l branch (git symbolic-ref HEAD 2>/dev/null) set branch (string replace -r "^refs/heads/" "" $branch) set -l vcs | > > > > > | | 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 | function fish_prompt --description 'Write out the prompt' set -l suffix switch "$USER" case root toor set suffix (set_color $fish_color_cwd_root)'#' case '*' set suffix '>' end set -l branch (git symbolic-ref HEAD 2>/dev/null) set branch (string replace -r "^refs/heads/" "" $branch) if test -z "$branch" set branch (fossil branch current) end set -l vcs if test -n "$branch" set vcs (set_color $fish_color_vcs_braces)"(" \ (set_color $fish_color_vcs)"$branch" \ (set_color $fish_color_vcs_braces)")" end echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \ (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \ |
︙ | ︙ |
Changes to zshrc.
︙ | ︙ | |||
95 96 97 98 99 100 101 | } fi set_prompt __precmd() { __update_terminal_cwd | | | < < < < | < < | | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | } fi set_prompt __precmd() { __update_terminal_cwd local branch=$(git symbolic-ref HEAD 2>/dev/null) branch=${branch##refs/heads/} if [ -z "$branch" ]; then branch=$(fossil branch current 2>/dev/null) fi set_prompt $branch } case $TERM in aterm|Eterm|rxvt*|uxterm*|xterm*) |
︙ | ︙ |