Giter VIP home page Giter VIP logo

rainbow-bash-prompt's Introduction

rainbow-bash-prompt

rainbow-bash-prompt makes your bash prompt rainbow by using dosentmatter/lolcat.

demo

If you are looking for a rainbow prompt for zsh, check out dosentmatter/rainbow-zsh-prompt

Installation

Tested on macOS Sierra (Terminal and iTerm2) and Ubuntu (GNOME Terminal)

  1. bash must be compiled with readline.
  2. Install C implementation of dosentmatter/lolcat for speed.
    • That is a fork of jaseg/lolcat with a minor change to make the colors pseudo random.
    • Put the binary in your $PATH and name it lolcat-c
  3. copy .bash_prompt to your $HOME directory
  4. Add this to your .bashrc:
if [[ -f ~/.bash_prompt ]]; then
  . ~/.bash_prompt
fi

Use

  • You can turn on and off debugging by setting PS1_DEBUG to 'true' or 'false'. Debugging is used to show the non-printing characters and highlight them. It has a line wrap issue as shown in the asciinema recording above that seems to be caused by colored prompts that are too long. This is not an issue because it is only meant for debugging.
  • You can change the command used to colorize PS1 by setting PS1_COLORIZE_COMMAND to a name of a function.
    • Currently, it is set to '__ps1_lolcat' which uses lolcat-c for speed.
    • If you have rbenv with ruby busyloop/lolcat or pyenv with python tehmaze/lolcat installed, you can set PS1_COLORIZE_COMMAND to '__ps1_lolcat_ruby' or '__ps1_lolcat_python'
  • You can change the command used to format the debug output by setting PS1_DEBUG_COMMAND to a name of a function.
    • Currently, it is set to __ps1_debug which displays non-printing characters and colors them.

Caveats

To have double quotes " and backslashes \ work in both regular and debug mode, PS1 has to have \\" and \\\\ respectively to have the right number of escapes for both modes.

rainbow-bash-prompt's People

Contributors

dosentmatter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.