• Stars
    star
    1,192
  • Rank 39,244 (Top 0.8 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pretty, minimal, and fast prompt for Fish shell inspired by sindresorhus/pure
โฌ†๏ธ Hey! Want to migrate from v3.x to v4.x? Check our migration guide, done with :heart

pure ci-status fish-3 GitHub tag (latest SemVer) sponsors

Pretty, minimal and fast Fish ๐ŸŸ prompt, ported from zsh.

Pure with dark colorscheme Pure with light colorscheme

๐Ÿš€ Install

โš ๏ธ requirements: fish โ‰ฅ3.x

Fisher

fisher install pure-fish/pure

Manually

Via cURL:

# Download the installer to `/tmp`
curl git.io/pure-fish --output /tmp/pure_installer.fish --location --silent
# Source and trigger the installer
source /tmp/pure_installer.fish; and install_pure

Features

Fully customizable (colors, symbols and features):

  • Excellent prompt character โฏ :
    • Change โฏ to red when previous command has failed ;
    • Start prompt with current working directory ๐Ÿด ;
    • Compact-mode (single-line prompt) ๐Ÿด ;
  • Display current directory tail ;
  • check for new release on start ๐Ÿด ;
  • Display username and hostname when in an SSH session ;
  • Display command duration when longer than 5 seconds ;
  • Display Python virtualenv when activated ;
  • Display VI mode and custom symbol for non-insert mode ๐Ÿด ;
  • Show system time ๐Ÿด ;
  • Show number of running jobs ๐Ÿด ;
  • Prefix when root ๐Ÿด ;
  • Display git branch name ๐Ÿด ;
    • Display * when git repository is dirty ;
    • Display โ‰ก when git repository is stashed ;
    • Display โ‡ก when branch is ahead (commits to push) ;
    • Display โ‡ฃ when branch is behind (commits to pull) ;
    • Async update when configured with fish-async-prompt ;
  • Update terminal title with current folder and command ;
  • Detect when running in a container

๐Ÿด: Enabled or disabled via a feature flag.

๐Ÿ–Œ๏ธ Configuration

You can tweak pure behavior and color by changing universal variables either directly in the terminal or in your config.fish, e.g.:

set --universal pure_show_system_time true
set --universal pure_color_system_time pure_color_mute

Prompt Symbol

Option Default Description
pure_symbol_git_dirty * Repository is Dirty (uncommitted/untracked changes).
pure_symbol_git_stash โ‰ก Repository git stash status.
pure_symbol_git_unpulled_commits โ‡ฃ Branch is behind upstream (commits to pull).
pure_symbol_git_unpushed_commits โ‡ก Branch is ahead upstream (commits to push).
pure_symbol_prefix_root_prompt # Prefix prompt when logged in as root.
pure_symbol_prompt โฏ Prompt symbol.
pure_symbol_reverse_prompt โฎ VI non-insert mode symbol.
pure_symbol_title_bar_separator - Separator in terminal's windows title.

โ„น๏ธ Need safer git symbols?

๐Ÿ”Œ Features' Flags

Option Default Description
pure_begin_prompt_with_current_directory true true: pwd git, SSH, duration.
false: SSH pwd git, duration.
pure_check_for_new_release false true: check repo for new release (on every shell start)
pure_enable_git true Show info about Git repository.
pure_enable_container_detection true false: Do not check if run in container (e.g. docker, podman, LXC/LXD, etc.).
โš ๏ธ Detection is a bit tricky across OSes.
pure_enable_single_line_prompt false true: Compact prompt as a single line
pure_reverse_prompt_symbol_in_vimode true true: โฎ indicate a non-insert mode.
false: indicate vi mode with [I], [N], [V].
pure_separate_prompt_on_error false Show last command exit code as a separate character.
pure_show_jobs false Show Number of running jobs
pure_show_prefix_root_prompt false true: shows prompt prefix when logged in as root.
pure_show_subsecond_command_duration false Show subsecond (ex. 1.5s) in command duration.
pure_show_system_time false true: shows system time before the prompt symbol (as %H:%M:%S).
pure_threshold_command_duration 5 Show command duration when above this value (seconds).

๐ŸŽจ Colours

โ„น๏ธ See set_color documentation for full possibilities.

โš ๏ธ The absence of $ sign is expected in pure_ named colours.

Base Color Inherited by Default
pure_color_danger pure_color_prompt_on_error red
pure_color_dark black
pure_color_info pure_color_git_unpulled_commits
pure_color_git_unpushed_commits
cyan
pure_color_light pure_color_username_root white
pure_color_mute pure_color_git_branch
pure_color_git_dirty
pure_color_git_stash
pure_color_hostname
pure_color_at_sign
pure_color_username_normal
pure_color_virtualenv
brblack
pure_color_normal pure_color_jobs normal
pure_color_primary pure_color_current_directory blue
pure_color_success pure_color_prompt_on_success magenta
pure_color_warning pure_color_command_duration yellow

๐Ÿ‘ Contribute

requirements: docker (isolate from your environment)

Specify the FISH_VERSION you want, and the CMD executed by the container:

make build-pure-on FISH_VERSION=3.3.1
make dev-pure-on FISH_VERSION=3.3.1 CMD="fishtape tests/*.test.fish"

๐Ÿ‘จโ€๐Ÿ’ป Maintainer

๐Ÿ‘ Thanks

๐Ÿ›๏ธ License

MIT