Releases: r-lib/cli
cli 3.3.0
-
style_hyperlink()no longer breaks if the env varibleVTE_VERSION
is of the form\d{4}, i.e., 4 consecutive numbers (#441, @MichaelChirico) -
ansi_*()functions support ANSI hyperlinks again (#444). -
Turning off ANSI colors via the
cli.num_colorsoption or the
R_CLI_NUM_COLORSor theNO_COLORenvironment variable now also turns off
ANSI hyperlinks (#447). -
symbolnow only has two variants: UTF-8 and ASCII. There are no special
variants for RStudio and Windows RGui any more (#424).
v3.2.0
Breaking change
- The
cli_theme_darkoption is know known ascli.theme_dark, to be
consistent with all other cli option names (#380).
Other changes
-
The preferred names of the S3 clases
ansi_string,ansi_style,boxx,
ruleandtreenow havecli_prefix:cli_ansi_string, etc. This will
help avoiding name conflicts with other packages eventually, but for now
the old names are kept as well, for compatibility. -
cli_abort()has been updated to work nicely with rlang 1.0. The
defaultcalland backtrace soft-truncation are set to.envir
(which itself is set to the immediate caller ofcli_abort()by
default).Line formatting now happens lazily at display time via
rlang::cnd_message()(which is called by theconditionMessage()
method for rlang errors). -
New
hash_sha256()function to calculate SHA-256 hashes. New
hash_raw_*(),hash_obj_*()andhash_file_*()functions to calculate
various hashes of raw vectors, R objects and files. -
You can use the new
cli.default_num_colorsoption to set the default
number of ANSI colors, only if ANSI support is otherwise detected.
See the details in the manual ofnum_ansi_colors(). -
You can set the new
ESS_BACKGROUND_MODEenvironment variable to
darkto indicate dark mode. -
cli now handles quotes and comment characters better in the semantion
cli_*()functions that perform glue string interpolation (#370).
v3.1.1
v3.1.0
Breaking changes
- The C progress bar API now uses
doubleinstead ofintas 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
NAvalues 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()andansi_strip()now havesgrandcsi
arguments to look for SGR tags, CSI tags, or both.
- most
-
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_palettesfor details. -
True color support:
num_ansi_colors()now detects terminals with
24 bit color support, andmake_ansi_style()uses the exact RGB colors
on these terminals (#208). -
The new
col_br_*()andbg_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, seecode_theme_list()(#348). -
New functions for hashing:
hash_animal(),hash_emoji()and
hash_md5(). -
New
diff_chr()anddiff_str()functions to calculate the difference
of character vectors and letters of strings.
Smaller improvements
-
Progress bars with
clear = FALSEnow print the last, completed, state
properly. -
The progress bar for Shiny apps now handles output from
cli_progress_output(). -
Progress variables in C
format_donestrings 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_sparkobjects now haveformat()andprint()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
activesink()(#366).
cli 3.0.1
v3.0.1
v3.0.0
-
New functions for progress bars, please see the new articles at
https://cli.r-lib.org/articles/ for details. -
New
cli_abort(),cli_warn()andcli_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
-
New
style_no_*()functions to locally undo styling.
Newcol_none()andbg_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 toNULLor"none". -
cli_memo()was renamed tocli_bullets(), as it is by default
formatted as a bullet list (#250). -
New
ansi_toupper(),ansi_tolowerandansi_chartr()functions,
the ANSI styling aware variants oftoupper(),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:
.clsto format class names, e.g.
"{.var fit} must be an {.cls lm} object".
v2.4.0
-
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()andspark_line()funcions to draw small bar or
line charts.
v.2.3.1
v2.3.0
-
boxx()now correctly calculates the width of the box for non-ASCII
characters. -
New
ansi_trimws()andansi_strwrap()functions, they are similar
totrimws()andstrwrap()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 returnansi_stringobjects. -
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.