Skip to content

mfornos/ansi-bfl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANSI Bash Function Library

Bash functions for Terminals with ANSI support.

Features

  • Coloured text
  • Titles and headings
  • Text alignment and formatting
  • Strip ANSI escape sequences
  • Color conversions and aliases

How it looks?

Here some screenshots from the demo script in the examples folder.

Colors demo

Report demo

How it feels?

Coloured text

ansi::fg red
echo Hello!
ansi::reset
echo "$(ansi::fg red)Hello!"
ansi::fg 2
echo Hello!

Headers

ansi::heading "Heading 1"
ansi::title "Title 1" "*"

Aligned text

ansi::right "LOREM IPSUM"
ansi::left_right "Summary" "0.10 $(ansi::fg blue)YES$(ansi::reset)" 80

How it works?

On most typical terminals and operating systems ANSI Bash Function Library should work out of the box, if you don't see any colors or the output is not exactly what you expect, you probably have a terminal type that doesn't handle all the ANSI terminal codes used by ansi-bfl.

On Linux, FreeBSD or OpenBSD you could try to set

TERM=xterm-256color

On AIX and Solaris you could try with

TERM=dtterm

Reading the terminfo, termcap and term manual pages can help you to find out which terminal type should be set.

// EOF

About

ANSI Bash Function Library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages