Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A customizable and informative prompt for bash, zsh, fish, on linux and macOS.

License

NotificationsYou must be signed in to change notification settings

danieltodor/blaze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A customizable and informative prompt for bash, fish, zsh, on linux and macOS.

Features: easily configurable, transient prompt, git integration, command execution time,exit status, user defined modules, and more.

Installation
Configuration
Builtin modules
Creating your own modules
Update
Removal

Installation

  1. Download and install blaze
    Requirements:git,make,g++

    git clone https://github.com/danieltodor/blaze.git&&cd blaze&&make install release=y
  2. Setup your shell
    Make sure~/.local/bin is added to PATH.

    • Bash
      echo'eval "$(blaze bash --init)"'>>~/.bashrc
    • Fish
      Depending on your config, you should move the added line where only interactive shells will use it.
      echo'blaze fish --init | source'>>~/.config/fish/config.fish
    • Zsh
      echo'eval "$(blaze zsh --init)"'>>~/.zshrc
  3. Configure
    Open a new shell instance, and select a configuration with the./use_config <name> command.
    For additional configuration options, check out theconfiguration section.
    It is recommended to use anerd font in your terminal emulator,so that the symbols are displayed correctly.
    Note that some of the configs are suitable only for shells with right prompt.

Configuration

Configuration files are read from these locations in order:

  1. BLAZE_CONFIG env variable
  2. ~/.config/blaze/config.toml
# For color values you can use named values like "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white".# If your terminal emulator supports the aixterm specification, you can also use these colors with the "bright_" prefix.# You can use color ids from "0" to "255". https://www.ditig.com/256-colors-cheat-sheet# If your terminal emulator has truecolor support, you can also use RGB and hexadecimal colors like "145, 255, 0" or "#3dff59".# Special values:#   - "default" The background color of the (xterm compatible) terminal emulator.[global]# This will be added before and after the string in each modulepadding =""[prompt]# Prompt stringstring =""# Foreground color to useforeground =""# Foreground color to use when the last command was exited with non zero code. Use only if different from foregrounderror_foreground =""# Separate prompts with additional new linenew_line =false# Create a separator line between prompts from this characterseparator =""# Modules are displayed only for the last prompttransient =false# Start prompt on the bottom of the terminal windowbottom =false[connector]# This character will be used as spacing between the left and right side modulescharacter =""# Foreground color to useforeground =""# Background color to usebackground =""# Text styling to usedim =false[[module]]# Name of a builtin modulename =""# Execute a user defined moduleexecute =""# Optional content for certain modulescontent =""# Which level the module should be displayed on (required only for multilevel prompt)level =1# The position of the module (if omitted, modules will be displayed as they appear in config)position =1# Display it on left/right side. Or display it as right_prompt if the shell supports italign ="left"# Same as global one, but takes precedence over itpadding =""# Displayed inside the module, before the content (foreground used as color)inner_prefix =""# Displayed inside the module, after the content (foreground used as color)inner_suffix =""# Displayed as the beginning of the module (background used as color)outer_prefix =""# Displayed as the end of the module (background used as color)outer_suffix =""# Foreground color to useforeground =""# Background color to usebackground =""# Text styling to usebold =falsedim =falseitalic =falseunderline =false[directory]# Maximum number of parent folders to display. Use 0 to disable truncationlimit =10# Show folders from the root of the repositoryfrom_repository =true[duration]# Display module if execution time exceeds thresholdthreshold =2.0# Digits displayed after secondsprecision =1# Display franctional part if less than thisfractional_until =10.0[status]# Show exit status when it is 0 (success)show_zero =false[git_branch]# Show branch name even when the HEAD is in a detached stateshow_when_detached =false# Ignore branches that matches these regex patterns, e.g.: "^master"ignore = [][git_commit]# Show commit hash even when the HEAD points to a branchshow_when_attached =false# Commit hash length (might be longer, depending on uniqueness). Use 0 to disable trimminglength =7[git_status]# Show the number of changescount =true# Spacing between the elementsspacing =""# Displayed when the repository is cleanclean =""# Displayed when the current branch is ahead of the remote branchahead =""# Displayed when the current branch is behind the remote branchbehind =""# Displayed when there are stashed filesstashed ="$"# Displayed when there are untracked filesuntracked ="?"# Displayed when there are conflicted filesconflicted ="="# Displayed when there are modified filesmodified ="!"# Displayed when there are staged filesstaged ="+"# Displayed when there are renamed filesrenamed ="»"# Displayed when there are deleted filesdeleted =""[date]# Date format to useformat ="%x"[time]# Time format to useformat ="%X"

Builtin modules

NameDescription
fixedCan be used to display fixed text
separatorCan be used for additional separation between modules
directoryCurrent working directory
durationExecution time of the last command (wall time)
statusExit status of the last command
git_branchActive branch in the repository
git_commitCommit hash
git_statusSymbols indicating the current state of the repository
dateCurrent date(format options)
timeCurrent time(format options)
userCurrent user
hostHostname
shellCurrently active shell

Creating your own modules

You can use the programming language of your choice to create a custom module.

  1. Create a script/binary that writes something to stdout.
# Check the PWD and/or the file/directory contents, or whatever you need.# At the end, write something to stdout.# If stdout is empty at the end, the module and its prefix/suffix content won't be displayed.# This way you can create modules that are only used in certain directories.print('something')
  1. Create a new module entry in your config file, and tell blaze how and where it can be executed.
[[module]]execute ="python path/to/file.py"# Additional styling like background, foreground, etc

Update

cd into the downloaded blaze directory and run this one-liner to update it.

git pull&& make clean&& make install release=y

It is advised to also update the config either via the./use_config <name> command, or manually,as sometimes there are breaking changes.

Removal

  1. Delete the setup line from your shell's rc file.
  2. cd into the downloaded blaze directory and runmake uninstall.
  3. Delete theconfig.toml file if you created one.

About

A customizable and informative prompt for bash, zsh, fish, on linux and macOS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp