jj/tests
Martin von Zweigbergk 5cf2b6615a formatter: use crossterm for colors
Let's use `crossterm` to make `ColorFormatter` a little more readable,
and maybe also more portable.

This uses the `SetForegroundColor()` function, which uses the escapes
for 256-color support (code 38) instead of the 8-color escapes (codes
30-37) combined with bold/bright (code 1) we were using before. IIUC,
most terminals support the 16 base colors when using the 256-color
escape even if they don't support all the 256 colors. It seems like an
improvement to use actual color codes for the bright colors too,
instead of assuming that terminals render bold as bright (even though
most terminals do).

Before this commit, we relied on ANSI escape 1 - which is specified to
make the font bold - to make the color brighter. That's why we call
the colors "bright blue" etc. When we switch from using code 30-37 to
using 38 to let our color config just control the color (not using
escape1), we therefore lose the bold font on many terminals (at least
in iTerm2 and in the terminal application on my Debian work
computer). As a workaround, I made us still use escape 1 when the
bright colors are used. I'll make boldness a separately configurable
attribute soon. Then we'll be able to remove this hack.

With the switch to `crossterm`, we also reset just the foreground
color (code 39) instead of resetting all attributes (code 0). That
also seems like an improvement, probably making it easier for us to
later support different background colors, underlining, etc.
2023-01-13 21:47:50 -08:00
..
common Add a config edit command to open jj config in editor 2023-01-12 01:10:07 -06:00
test_abandon_command.rs jj abandon: Print every abandoned commit 2023-01-11 23:32:39 -08:00
test_alias.rs formatter: use crossterm for colors 2023-01-13 21:47:50 -08:00
test_branch_command.rs feat(branch): support jj branch forget --glob 2022-12-10 16:51:10 -08:00
test_checkout.rs Improve short_commit_description for commits without a description 2023-01-11 23:32:39 -08:00
test_commit_command.rs cli: include diff summary in commit/describe editor content 2022-12-23 00:47:22 +09:00
test_commit_template.rs formatter: use crossterm for colors 2023-01-13 21:47:50 -08:00
test_concurrent_operations.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_config_command.rs Add a config edit command to open jj config in editor 2023-01-12 01:10:07 -06:00
test_debug_command.rs Add "jj debug config-schema" command to output JSON schema 2023-01-03 22:02:25 -06:00
test_describe_command.rs tests: use insta to test editor contents 2022-12-23 00:47:22 +09:00
test_diff_command.rs cli: allow multiple diff outputs 2022-12-15 11:41:42 +09:00
test_diffedit_command.rs run_merge_tool, edit_diff: Print command args with -v instead of errors 2023-01-12 23:07:59 -08:00
test_edit_command.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_git_clone.rs cli: on clone, turn local git remote to absolute path 2022-12-07 14:14:31 +09:00
test_git_colocated.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_git_export.rs
test_git_push.rs backend: make random ChangeId fully random, remove UUID mask bits 2023-01-14 14:37:45 +09:00
test_git_remotes.rs
test_gitignores.rs
test_global_opts.rs formatter: use crossterm for colors 2023-01-13 21:47:50 -08:00
test_init_command.rs
test_interdiff_command.rs
test_log_command.rs formatter: use crossterm for colors 2023-01-13 21:47:50 -08:00
test_move_command.rs tests: use insta to test editor contents 2022-12-23 00:47:22 +09:00
test_new_command.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_obslog_command.rs cli: normalize line ending of edited commit description, ensure last newline 2022-12-22 14:59:03 +09:00
test_operations.rs jj op log: Show durations with relative timestamps 2023-01-07 12:08:00 -08:00
test_print_command.rs
test_rebase_command.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_resolve_command.rs formatter: use crossterm for colors 2023-01-13 21:47:50 -08:00
test_restore_command.rs cmd: Remove the -i option to jj restore. 2022-12-21 08:15:06 -08:00
test_revset_output.rs revset: parse hg/git-like '^' postfix operator and show hint 2022-12-23 00:38:29 +09:00
test_show_command.rs
test_sparse_command.rs
test_split_command.rs cli: rephrase diff summary header so it can be reused for commit/describe 2022-12-23 00:47:22 +09:00
test_squash_command.rs tests: use insta to test editor contents 2022-12-23 00:47:22 +09:00
test_status_command.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_templater.rs jj log: Change conflicted branches from br? to br?? 2023-01-09 22:44:45 -08:00
test_undo.rs
test_unsquash_command.rs jj log: Change conflicted branches from br? to br?? 2023-01-09 22:44:45 -08:00
test_untrack_command.rs
test_workspaces.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00