Программа ansi, написанная на “чистом” bash, позволяет выполнять консольный вывод с использованием различных цветов фона и текста, жирных и курсивных шрифтов, подчеркивания, мигающего текста и т.д. Консольный терминал должен поддерживать управляющие коды ANSI (escape - коды).
ansi --help
.Generate ANSI escape codes
Please keep in mind that your terminal must support the code in order for you
to see the effect properly.
Usage
ansi [OPTIONS] [TEXT TO OUTPUT]
Option processing stops at the first unknown option or at "--". Options
are applied in order as specified on the command line. Unless --no-restore
is used, the options are unapplied in reverse order, restoring your
terminal to normal.
Optional parameters are surrounded in brackets and use reasonable defaults.
For instance, using --down will move the cursor down one line and --down=10
moves the cursor down 10 lines.
Display Manipulation
--insert-chars[=N], --insert-char[=N], --ich[=N]
Insert blanks at cursor, shifting the line right.
--erase-display[=N], --ed[=N]
Erase in display. 0=below, 1=above, 2=all,
3=saved.
--erase-line=[N], --el[=N]
Erase in line. 0=right, 1=left, 2=all.
--insert-lines[=N], --insert-line[=N], --il[=N]
--delete-lines[=N], --delete-line[=N], --dl[=N]
--delete-chars[=N], --delete-char[=N], --dch[=N]
--scroll-up[=N], --su[=N]
--scroll-down[=N], --sd[=N]
--erase-chars[=N], --erase-char[=N], --ech[=N]
--repeat[=N], --rep[=N] Repeat preceding character N times.
Cursor:
--up[=N], --cuu[=N]
--down[=N], --cud[=N]
--forward[=N], --cuf[=N]
--backward[=N], --cub[=N]
--next-line[=N], --cnl[=N]
--previous-line[=N], --prev-line[=N], --cpl[=N]
--column[=N], --cha[=N]
--position[=[ROW],[COL]], --cup[=[ROW],[=COL]]
--tab-forward[=N] Move forward N tab stops.
--tab-backward[=N] Move backward N tab stops.
--column-relative[=N], --hpr[=N]
--line[=N], --vpa[=N]
--line-relative[=N], --vpr[=N]
--save-cursor Saves the cursor position. Restores the cursor
after writing text to the terminal unless
--no-restore is also used.
--restore-cursor Just restores the cursor.
--hide-cursor Will automatically show cursor unless --no-restore
is also used.
--show-cursor
Text:
Attributes:
--bold, --faint, --normal
--italic, --fraktur, --plain
--underline, --double-underline, --no-underline
--blink, --rapid-blink, --no-blink
--inverse, --no-inverse
--invisible, --visible
--strike, --no-strike
--frame, --encircle, --no-border
--overline, --no-overline
--ideogram-right, --ideogram-right-double, --ideogram-left,
--ideogram-left-double, --ideogram-stress, --reset-ideogram
--font=NUM (NUM must be from 0 through 9 and 0 is the primary font)
Foreground:
--black, --red, --green, --yellow, --blue, --magenta, --cyan, --white,
--black-intense, --red-intense, --green-intense, --yellow-intense,
--blue-intense, --magenta-intense, --cyan-intense, --white-intense,
--color=CODE, --rgb=R,G,B
Background:
--bg-black, --bg-red, --bg-green, --bg-yellow, --bg-blue,
--bg-magenta, --bg-cyan, --bg-white, --bg-black-intense,
--bg-red-intense, --bg-green-intense, --bg-yellow-intense,
--bg-blue-intense, --bg-magenta-intense, --bg-cyan-intense,
--bg-white-intense, --bg-color=CODE, --bg-rgb=R,G,B
Reset:
--reset-attrib Removes bold, italics, etc.
--reset-foreground Sets foreground to default color.
--reset-background Sets background to default color.
--reset-color Resets attributes, foreground, background.
--reset-font Switches back to the primary font.
Report:
** NOTE: These require reading from stdin. Results are sent to stdout.
** If no response from terminal in 1 second, these commands fail.
--report-position ROW,COL
--report-window-state "open" or "iconified"
--report-window-position X,Y
--report-window-pixels HEIGHT,WIDTH
--report-window-chars ROWS,COLS
--report-screen-chars ROWS,COLS of the entire screen
--report-icon
--report-title
Miscellaneous:
--color-table Display a color table.
--color-codes Show the different color codes.
--icon=NAME Set the terminal's icon name.
--title=TITLE Set the terminal's window title.
--no-restore Do not issue reset codes when changing colors.
For example, if you change the color to green,
normally the color is restored to default
afterwards. With this flag, the color will
stay green even when the command finishes.
-n, --no-newline Suppress newline at the end of the line.
--bell Add the terminal's bell sequence to the output.
--reset Reset colors, clear screen, show cursor, move
cursor to (1,1), and reset the font.