Crates.io | mshp |
lib.rs | mshp |
version | 0.2.0 |
source | src |
created_at | 2020-06-21 12:08:29.572521 |
updated_at | 2020-06-26 21:57:07.963389 |
description | A minimal and fast shell prompt |
homepage | https://github.com/yuqio/mshp |
repository | https://github.com/yuqio/mshp |
max_upload_size | |
id | 256301 |
size | 99,318 |
A minimal and fast shell prompt written in Rust.
cargo install mshp
PATH
On most POSIX compatible shells you can add the following line to your init file (e.g. .bashrc
):
PS1="$(mshp)"
Add the following to your .zshrc
file:
precmd() {
PS1="$(mshp)"
}
Add the following to your .config/ion/initrc
file:
fn PROMPT
echo -n "$(mshp)"
end
mshp
can be configured via environment variables.
Color
: Takes one of the following as value:
default
(case insensitive) (sets the color to the default foreground color defined by the terminal)black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
) (case insensitive)1
for red)#
(e.g. #00F
or #0000FF
for blue)Boolean
: Takes either 0
/false
(deactivate setting) or 1
/true
(activate setting) as value
String
: Takes any value
MSHP_PATH_COLOR
Sets the foreground color of the current working directory.
Type: Color
, Default: blue
MSHP_GIT_BRANCH_ICON
Sets the icon that is displayed next to the git branch.
Type: String
, Default:
MSHP_GIT_BRANCH_COLOR
Sets the foreground color used to display the git branch and the icon.
Type: Color
, Default: cyan
MSHP_GIT_BRANCH_DISABLE
Disables the git branch and icon.
Type: Boolean
, Default: false
MSHP_GIT_STATUS_STAGED_ICON
Sets the icon that is used to indicate uncommited and staged changes in the git repo.
Type: String
, Default: +
MSHP_GIT_STATUS_UNSTAGED_ICON
Sets the icon that is used to indicate uncommited and unstaged changes in the git repo.
Type: String
, Default: !
MSHP_GIT_STATUS_UNTRACKED_ICON
Sets the icon that is used to indicate untracked files in the git repo.
Type: String
, Default: !
MSHP_GIT_STATUS_AHEAD_ICON
Sets the icon that is used to indicate that your local branch is ahead of the upstream branch.
Type: String
, Default: ↥
MSHP_GIT_STATUS_BEHIND_ICON
Sets the icon that is used to indicate that your local branch is behind the upstream branch.
Type: String
, Default: ↧
MSHP_GIT_STATUS_COLOR
Sets the color for the above mentioned icons.
Type: Color
, Default: cyan
MSHP_GIT_STATUS_DISABLE
Disables the above mentioned icons.
Type: Boolean
, Default: false
MSHP_CHAR_USER_ICON
Sets the icon that is displayed at the end of the prompt to indicate that the current user is not the root user.
Type: String
, Default: $
MSHP_CHAR_USER_COLOR
Sets the color for the user character.
Type: Color
, Default: green
MSHP_CHAR_USER_FAILED_ICON
Sets the icon that is displayed at the end of the prompt to indicate that the current user is not the root user when the previous command failed.
Type: String
, Default: $
MSHP_CHAR_USER_FAILED_COLOR
Sets the color for the user character when the previous command failed.
Type: Color
, Default: red
MSHP_CHAR_ROOT_ICON
Sets the icon that is displayed at the end of the prompt to indicate that the current user is the root user.
Type: String
, Default: #
MSHP_CHAR_ROOT_COLOR
Sets the color for the root character.
Type: Color
, Default: green
MSHP_CHAR_ROOT_FAILED_ICON
Sets the icon that is displayed at the end of the prompt to indicate that the current user is the root user when the previous command failed.
Type: String
, Default: #
MSHP_CHAR_ROOT_FAILED_COLOR
Sets the color for the root character when the previous command failed.
Type: Color
, Default: red
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.