You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid resetting color when setting/resetting different style codes
66
+
```nu
67
+
> $'Set color to (ansi g)GREEN then style to (ansi bo)BOLD(ansi rst_bo) or (ansi d)DIMMED(ansi rst_d) or (ansi i)ITALICS(ansi rst_i) or (ansi u)UNDERLINE(ansi rst_u) or (ansi re)REVERSE(ansi rst_re) or (ansi h)HIDDEN(ansi rst_h) or (ansi s)STRIKE(ansi rst_s) then (ansi rst)reset everything'
68
+
Set color to GREEN then style to BOLD or DIMMED or ITALICS or UNDERLINE or REVERSE or HIDDEN or STRIKE then reset everything
69
+
```
70
+
65
71
Use escape codes, without the '\x1b['
66
72
```nu
67
73
> $"(ansi --escape '3;93;41m')Hello(ansi reset)" # italic bright yellow on red background
68
74
Hello
69
75
```
70
76
77
+
Use simple hex string
78
+
```nu
79
+
> $"(ansi '#4169E1')Hello(ansi reset)" # royal blue foreground color
80
+
Hello
81
+
```
82
+
71
83
Use structured escape codes
72
84
```nu
73
85
> let bold_blue_on_red = { # `fg`, `bg`, `attr` are the acceptable keys, all other keys are considered invalid and will throw errors.
0 commit comments