Skip to content

Releases: r-lib/cli

v3.1.0

27 Oct 17:32
Compare
Choose a tag to compare

Breaking changes

  • The C progress bar API now uses double instead of int as the data
    type of the progress units (#335).

New features

  • Several improvements and changes in the ansi_*() functions:

    • most ansi_*() functions are now implemented in C and they are
      much faster (#316).
    • they handle NA values better.
    • many functions now use UTF-8 graphemes by default instead of code
      points. E.g. ansi_nchar() counts graphemes, etc.
    • they convert their input to UTF-8 and always return UTF-8
      encoded strings.
    • new function ansi_simplify() to remove superfluous ANSI tags.
    • new function ansi_html() to convert ANSI-highlighted strings
      to HTML.
    • ansi_has_any() and ansi_strip() now have sgr and csi
      arguments to look for SGR tags, CSI tags, or both.
  • New functions that handle UTF-8 encoded strings correctly:
    utf8_graphemes(), utf8_nchar(), utf8_substr().

  • Support for palettes, including a colorblind friendly palette.
    See ?ansi_palettes for details.

  • True color support: num_ansi_colors() now detects terminals with
    24 bit color support, and make_ansi_style() uses the exact RGB colors
    on these terminals (#208).

  • The new col_br_*() and bg_br_() functions create bright versions of
    eight base ANSI colors (#327).

  • New function code_highlight() to syntax highlight R code. It supports
    several themes out of the box, see code_theme_list() (#348).

  • New functions for hashing: hash_animal(), hash_emoji() and
    hash_md5().

  • New diff_chr() and diff_str() functions to calculate the difference
    of character vectors and letters of strings.

Smaller improvements

  • Progress bars with clear = FALSE now print the last, completed, state
    properly.

  • The progress bar for Shiny apps now handles output from
    cli_progress_output().

  • Progress variables in C format_done strings work correctly now (#337).

  • cli_dl() now works with an empty description, and gives a better
    error for invalid input (#347).

  • rule() is now works better if the labels have ANSI markup.

  • cli_spark objects now have format() and print() methods.

  • cli_process_done() now does not error without a process (#351).

  • ANSI markup is now supported in RStudio jobs (#353).

  • The lack of ANSI support is now again correctly detected if there is an
    active sink() (#366).

cli 3.0.1

  • ansi_strtrim() now correctly keeps NA values (#309).

  • format_inline() now uses the correct environment (@rundel, #314).

v3.0.1

17 Jul 09:34
Compare
Choose a tag to compare
  • ansi_strtrim() now correctly keeps NA values (#309).

  • format_inline() now uses the correct environment (@rundel, #314).

v3.0.0

30 Jun 15:28
Compare
Choose a tag to compare
  • New functions for progress bars, please see the new articles at
    https://cli.r-lib.org/articles/ for details.

  • New cli_abort(), cli_warn() and cli_inform() functions, to throw
    errors with cli pluralization and styling.

  • New format_inline() function to format a cli string without emitting
    it (#278).

v2.5.0

27 Apr 10:16
Compare
Choose a tag to compare
  • New style_no_*() functions to locally undo styling.
    New col_none() and bg_none() functions to locally undo text color
    and background color.

  • It is now possible to undo text and background color in a theme, by
    setting them to NULL or "none".

  • cli_memo() was renamed to cli_bullets(), as it is by default
    formatted as a bullet list (#250).

  • New ansi_toupper(), ansi_tolower and ansi_chartr() functions,
    the ANSI styling aware variants of toupper(), tolower() and
    chartr() (#248).

  • New test_that_cli() helper function to write testthat tests for
    cli output.

  • tree() now does not produce warnings for tibbles (#238).

  • New inline style: .cls to format class names, e.g.
    "{.var fit} must be an {.cls lm} object".

v2.4.0

05 Apr 18:00
Compare
Choose a tag to compare
  • New cli_memo() function to create a list of items or tasks.

  • New cli::cli() function to create a single cli message from multiple
    cli calls (#170).

  • cli now highlights weird names, e.g. path names with leading or
    trailing space (#227).

  • Styling is fixed at several places. In particular, nested lists should
    be now formatted better (#221).

  • New spark_bar() and spark_line() funcions to draw small bar or
    line charts.

v.2.3.1

26 Feb 20:02
Compare
Choose a tag to compare
  • ANSI color support detection works correctly now in older RStudio,
    and also on older R versions.

  • cli_h1(), cli_h2() and cli_h3() now work with multiple glue
    substitutions (#218).

v2.3.0

01 Feb 08:25
Compare
Choose a tag to compare
  • boxx() now correctly calculates the width of the box for non-ASCII
    characters.

  • New ansi_trimws() and ansi_strwrap() functions, they are similar
    to trimws() and strwrap() but work on ANSI strings.

  • New ansi_columns() function to format ANSI strings in multiple columns.

  • ansi_substr(), ansi_substring(), ansi_strsplit(), ansi_align()
    now always return ansi_string objects.

  • ansi_nchar(), ansi_align(), ansi_strtrim() and the new
    ansi_strwrap() as well handle wide Unicode correctly, according to
    their display width.

  • boxx() can now add headers and footers to boxes.

v2.2.0

23 Nov 10:07
Compare
Choose a tag to compare
  • New style_hyperlink() function to add hyperlinks, on terminals that
    support them.

  • cli_format_method() now works properly in knitr, and other environments
    that catch message conditions (#159).

  • ANSI strings created by col_*, bg_* and style_* now also add the
    character class to the result. This fixes issues with code that
    expect character objects.

  • New functions to manipulate ANSI strings: ansi_aling(),
    ansi_has_any(), ansi_nchar(), ansi_regex(), ansi_strip(),
    ansi_strsplit(), ansi_substr(), ansi_substring().

v2.1.0

16 Oct 08:56
Compare
Choose a tag to compare
  • New cli_vec() function to allow easier formatting of collapsed
    vectors. It is now also possible to use styling to set the collapsing
    parameters (#129).

  • New pluralize() function to perform pluralization without generating
    cli output (#155).

  • console_width() works better now in RStudio, and also in terminals.

  • Styling of verbatim text work properly now (#147, @tzakharko).

  • Messages (ie. message conditions) coming from cli now have the
    cliMessage class, so you can easily suppress them without suppressing
    other messages (#156).

  • cli prints the output to stderr() now, if there is an output or
    message sink. This is to make interactive and non-interactive sessions
    consistent (#153).

  • Pluralization works corrently now if the last alternative is the
    empty string (#158).

  • cli now caches the result of the dark background detection in iTerm on
    macOS. Reload cli to delete the cache (#131).

  • The is_dynamic_tty(), is_ansi_tty() and ansi_hide_cursor() and
    releted functions now default to the "auto" stream, which is
    automatically selected to be either stdout() or stderr().
    See the manual for details (#144).

  • The default theme now quotes file names, paths, email addresses if they
    don't start or end with an alphanumeric character or a slash. This is
    to make it easier to spot names that start or end with a space (#167).

  • make_spinner() clears the line properly now (@tzakharko, #164).

  • Semantic cli functions now automatically replace Unicode non-breaking
    space characters (\u00a0) with regular space characters, right before
    output. They are still used to calculate the line breaks, but not
    outputted (#161).

v2.0.2

28 Feb 13:51
Compare
Choose a tag to compare
  • The status bar now does not simplify multiple spaces by a single space.

  • cli now does not crash if it fails to detect whether the RStudio theme
    is a dark theme (#138).

  • cli now works better with wide Unicode characters, for example emojis.
    In particular, a status bar containing emojis is cleared properly (#133).

  • The status bar now does not flicker when updated, in terminals (#135).