Cross-shell prompt framework
DIYship is a cross-shell prompt framework that let you write your prompt with any programing language for any shell.
To install DIYship to your shell, simply append the correspond code file on this repo to your shell config file.
curl https://raw.githubusercontent.com/info-mono/diyship/main/bash >> ~/.bashrc
curl https://raw.githubusercontent.com/info-mono/diyship/main/zshrc >> ~/.zshrc
curl https://raw.githubusercontent.com/info-mono/diyship/main/fish >> ~/.config/fish/config.fish
curl https://raw.githubusercontent.com/info-mono/diyship/main/powerShell >> ~/.config/powershell/Microsoft.PowerShell_profile.ps1
curl https://raw.githubusercontent.com/info-mono/diyship/main/ion >> ~/.config/ion/initrc
curl https://raw.githubusercontent.com/info-mono/diyship/main/elvish >> ~/.elvish/rc.elv
Warning Only Elvish v0.18 or higher is supported.
curl https://raw.githubusercontent.com/info-mono/diyship/main/tcsh >> ~/.tcshrc
curl https://raw.githubusercontent.com/info-mono/diyship/main/nushell >> ~/.config/nu/config.toml
curl https://raw.githubusercontent.com/info-mono/diyship/main/xonsh >> ~/.xonshrc
Warning Only Nushell version v0.33 or higher is supported.
DIYship is basically execute a command (which could be a path to an executable script file or program) and take it output as a prompt, you can change the command through variable:
Environment variable | Description |
---|---|
DIYSHIP_COMMAND_LEFT |
Command to print left prompt. |
DIYSHIP_COMMAND_RIGHT |
Command to print right prompt. |
Note You can disable right prompt by
DIYSHIP_COMMAND_RIGHT="test"
DIYship will export these following environment variables before running the commands to print out prompts, so you could utilize theme informations in your script/program:
Environment variable | Description |
---|---|
$DIYSHIP_SHELL |
Current shell name. |
$DIYSHIP_STATUS |
The status code of the previously run command. |
$DIYSHIP_PIPESTATUS |
Status codes from a command pipeline. |
$DIYSHIP_DURATION |
The execution duration of the last command (in milliseconds). |
$DIYSHIP_JOBS |
The number of currently running jobs |
$DIYSHIP_KEYMAP |
The current keymap. |
Do to many technical limitation, not every shell support all features:
Feature | Bash | Zsh | Fish | Powershell | Ion | Elvish | Tcsh | Nushell | Xonsh |
---|---|---|---|---|---|---|---|---|---|
Left prompt | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Right prompt | ✅ | ✅ | ✅ | ✅ | |||||
Export current shell | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Export status | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ||
Export pipe status | ✅ | ✅ | ✅ | ||||||
Export duration | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Export jobs | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ||
Export keymap | ✅ | ✅ |
Note For more documentation and inspiration about writing your own prompt, checkout ours wiki and Starship's custom modules.
This project was heavily based on and inspired by Starship.
Made with ❤️ by
@info-mono