Skip to content

L_ansi

This section provides some minimal interface to the ANSI escape codes.

It is not full implementation, but enough to get you started.

Contributions are welcome. Consider a simple following usage example:

echo
for i in $(seq 5); do
  L_ansi_print_on_line_above 1 "Progress: $i/5"
  sleep 0.5
done

The functions here should be bare bones.

L_ansi_24bit_fg 200 100 200; echo Hello in pink $RESET

Generated documentation from source:

ansi

Very basic functions for manipulating cursor position and color.

Note

unstable

L_ansi_up

L_ansi_down

L_ansi_right

L_ansi_left

L_ansi_next_line

L_ansi_prev_line

L_ansi_set_column

L_ansi_set_position

L_ansi_set_title

$L_ANSI_CLEAR_SCREEN_UNTIL_END

$L_ANSI_CLEAR_SCREEN_UNTIL_BEGINNING

$L_ANSI_CLEAR_SCREEN

$L_ANSI_CLEAR_LINE_UNTIL_END

$L_ANSI_CLEAR_LINE_UNTIL_BEGINNING

$L_ANSI_CLEAR_LINE

$L_ANSI_SAVE_POSITION

$L_ANSI_RESTORE_POSITION

L_ansi_print_on_line_above

Move cursor $1 lines above, output second argument, then move cursor $1 lines down.

Arguments:

  • $1 int lines above
  • $2 str to print

L_ansi_8bit_fg

L_ansi_8bit_bg

L_ansi_8bit_fg_rgb

Set foreground color to 8bit RGB

Arguments:

  • $1 red
  • $2 green
  • $3 blue

L_ansi_8bit_bg_rgb

Set foreground color to 8bit RGB

Arguments:

  • $1 red
  • $2 green
  • $3 blue

L_ansi_24bit_fg

Set foreground color to 24bit RGB

Arguments:

  • $1 red
  • $2 green
  • $3 blue

L_ansi_24bit_bg

Set background color to 24bit RGB

Arguments:

  • $1 red
  • $2 green
  • $3 blue