https://github.com/shosatojp/messa
Width flexible powerline-shell like prompt
https://github.com/shosatojp/messa
bash powerline-shell prompt rust shell
Last synced: about 1 year ago
JSON representation
Width flexible powerline-shell like prompt
- Host: GitHub
- URL: https://github.com/shosatojp/messa
- Owner: shosatojp
- License: gpl-3.0
- Created: 2020-04-22T12:18:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-16T06:57:17.000Z (over 3 years ago)
- Last Synced: 2025-04-14T23:09:51.202Z (about 1 year ago)
- Topics: bash, powerline-shell, prompt, rust, shell
- Language: Rust
- Homepage: https://crates.io/crates/messa
- Size: 927 KB
- Stars: 9
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# messa
[](https://github.com/shosatojp/messa/actions/workflows/ci.yml)
- Width flexible shell prompt
- Fast
|normal directory|git directory|
|---|---|
|1.1 ms ± 0.2 ms|5.2 ms ± 0.1ms|
> measured with [hyperfine](https://github.com/sharkdp/hyperfine)
- Configure with yaml
- Supports ssh, git, kubernetes, datetime


## Install
### 1. Install `messa`
- statically linked single binary from [here](https://github.com/shosatojp/messa/releases/latest)
```sh
install -D -m 755 <(curl -L https://github.com/shosatojp/messa/releases/download/v2.1.0/messa) ~/.local/bin/messa
```
> You may need to modify PATH
> ```
> export PATH="$HOME/.local/bin:$PATH"
> ```
OR
- via `cargo`
- Requirements
- C Compiler
- `gcc`
- `pkg-config`
- OpenSSL Development Package
- Ubuntu/Debian: `libssl-dev`
- Fedora: `openssl-devel`
```sh
# ubuntu
sudo apt-get install -y gcc pkg-config libssl-dev
```
```sh
cargo install messa
```
### 2. Append following code to your shell config file
- **Bash**
```sh
# ~/.bashrc
export PATH="$HOME/.cargo/bin:$PATH"
function create_prompt(){
PS1=$(messa --error $? --width $COLUMNS --user $USER --host $HOSTNAME --shell bash)
}
export PROMPT_COMMAND="create_prompt;$PROMPT_COMMAND"
```
- **Zsh**
```sh
# ~/.zshrc
export PATH="$HOME/.cargo/bin:$PATH"
function create_prompt() {
PS1=$(messa --error $? --width $COLUMNS --user $USER --host $HOSTNAME --shell zsh)
}
precmd_functions+=(create_prompt)
```
- **Fish**
```sh
# ~/.config/fish/config.fish
function fish_prompt
messa --error $status --width $COLUMNS --user $USER --host $HOSTNAME --shell fish
end
```
- **Nushell** [🔗](https://www.nushell.sh/)
```sh
# command in nushell
config set prompt "messa --error 0 --width (tput cols) --user $nu.env.USER --host (hostname) --shell fish"
```
### 3. Setup config
```sh
wget -O ~/.messa.yaml https://raw.githubusercontent.com/shosatojp/messa/master/.messa.yaml
```
### 4. Reload your shell
```sh
. ~/.bashrc
```
## Build
```sh
cargo build
```
## Related projects
- [`powerline-shell`](https://github.com/b-ryan/powerline-shell) (Python)
- [`powerline-go`](https://github.com/justjanne/powerline-go) (Go)