Skip to contents

Generates a character string that can be used as a horizontal line separator in console output.

Usage

lineSep(sep = .getOption("linesep"))

Arguments

sep

A character string used as separator. If NULL, a default Unicode box-drawing character ("\u2500") is used. If sep consists of a single visible character, it is repeated to match the current console width (minus two characters).

Value

A character string representing a horizontal separator line.

Details

ANSI escape sequences (e.g., color codes) are removed using cli::ansi_strip() when determining the visible width.

The console width is determined via getOption("width", 80).

Examples

lineSep()
#> [1] "──────────────────────────────────────────────────────────────────────────────"
lineSep("-")
#> [1] "------------------------------------------------------------------------------"
lineSep(cli::col_red("="))
#> [1] "\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m\033[31m=\033[39m"