rusty-rich 0.4.3

Rich text and beautiful formatting in the terminal — a Rust port of Python's Rich library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
//! Theme system — equivalent to Rich's `theme.py`.
//!
//! A Theme maps style names (like "repr.number", "repr.str") to Style values,
//! allowing customizable color schemes for different renderable types.

use std::collections::HashMap;

use crate::style::Style;

// ---------------------------------------------------------------------------
// Theme
// ---------------------------------------------------------------------------

/// A set of named styles that can be applied to themed output.
#[derive(Debug, Clone)]
pub struct Theme {
    /// Mapping from style name → Style.
    pub styles: HashMap<String, Style>,
    /// Optional inherited base theme.
    pub inherit: Option<Box<Theme>>,
}

impl Theme {
    /// Create a new empty theme.
    pub fn new() -> Self {
        Self {
            styles: HashMap::new(),
            inherit: None,
        }
    }

    /// Create a theme that inherits from another.
    pub fn with_inherit(inherit: Theme) -> Self {
        Self {
            styles: HashMap::new(),
            inherit: Some(Box::new(inherit)),
        }
    }

    /// Look up a style by name. Falls back to the inherited theme.
    pub fn get(&self, name: &str) -> Option<&Style> {
        self.styles
            .get(name)
            .or_else(|| self.inherit.as_ref().and_then(|i| i.get(name)))
    }

    /// Set a named style.
    pub fn set(&mut self, name: impl Into<String>, style: Style) {
        self.styles.insert(name.into(), style);
    }

    /// Merge another theme's styles into this one.
    pub fn merge(&mut self, other: &Theme) {
        for (name, style) in &other.styles {
            self.styles
                .entry(name.clone())
                .or_insert_with(|| style.clone());
        }
    }
}

impl Default for Theme {
    fn default() -> Self {
        Self::new()
    }
}

// ---------------------------------------------------------------------------
// ThemeStack
// ---------------------------------------------------------------------------

/// A stack of themes — when looking up a style, themes are checked from
/// top to bottom until a match is found.
#[derive(Debug, Clone)]
pub struct ThemeStack {
    themes: Vec<Theme>,
}

impl Default for ThemeStack {
    fn default() -> Self {
        Self::new()
    }
}

impl ThemeStack {
    pub fn new() -> Self {
        Self { themes: Vec::new() }
    }

    pub fn push(&mut self, theme: Theme) {
        self.themes.push(theme);
    }

    pub fn pop(&mut self) -> Option<Theme> {
        self.themes.pop()
    }

    /// Look up a style name across the stack (top-down).
    pub fn get(&self, name: &str) -> Option<Style> {
        for theme in self.themes.iter().rev() {
            if let Some(s) = theme.get(name) {
                return Some(s.clone());
            }
        }
        None
    }
}

// ---------------------------------------------------------------------------
// Default themes
// ---------------------------------------------------------------------------

/// Built-in theme style names used by various Rich renderables.
pub mod names {
    // repr / pretty
    pub const REPR_NUMBER: &str = "repr.number";
    pub const REPR_STR: &str = "repr.str";
    pub const REPR_BOOL_TRUE: &str = "repr.bool_true";
    pub const REPR_BOOL_FALSE: &str = "repr.bool_false";
    pub const REPR_NONE: &str = "repr.none";
    pub const REPR_URL: &str = "repr.url";
    pub const REPR_PATH: &str = "repr.path";
    pub const REPR_IPV4: &str = "repr.ipv4";
    pub const REPR_IPV6: &str = "repr.ipv6";
    pub const REPR_ELLIPSIS: &str = "repr.ellipsis";
    pub const REPR_ATTRIB_NAME: &str = "repr.attrib_name";
    pub const REPR_ATTRIB_VALUE: &str = "repr.attrib_value";
    pub const REPR_TAG_NAME: &str = "repr.tag_name";
    pub const REPR_TAG_CONTENTS: &str = "repr.tag_contents";
    pub const REPR_TAG_PUNCTUATION: &str = "repr.tag_punctuation";
    pub const REPR_BRACE: &str = "repr.brace";
    pub const REPR_CALL: &str = "repr.call";
    pub const REPR_COMMA: &str = "repr.comma";
    pub const REPR_BOOL: &str = "repr.bool";
    pub const REPR_ERROR: &str = "repr.error";

    // table
    pub const TABLE_HEADER: &str = "table.header";
    pub const TABLE_CELL: &str = "table.cell";
    pub const TABLE_ROW: &str = "table.row";
    pub const TABLE_FOOTER: &str = "table.footer";
    pub const TABLE_TITLE: &str = "table.title";
    pub const TABLE_CAPTION: &str = "table.caption";
    pub const TABLE_BORDER: &str = "table.border";

    // logging
    pub const LOGGING_KEYWORD: &str = "logging.keyword";
    pub const LOGGING_LEVEL_DEBUG: &str = "logging.level.debug";
    pub const LOGGING_LEVEL_INFO: &str = "logging.level.info";
    pub const LOGGING_LEVEL_WARNING: &str = "logging.level.warning";
    pub const LOGGING_LEVEL_ERROR: &str = "logging.level.error";
    pub const LOGGING_LEVEL_CRITICAL: &str = "logging.level.critical";
    pub const LOGGING_LEVEL_NOTSET: &str = "logging.level.notset";

    // traceback
    pub const TRACEBACK_BORDER: &str = "traceback.border";
    pub const TRACEBACK_TITLE: &str = "traceback.title";
    pub const TRACEBACK_ERROR: &str = "traceback.error";
    pub const TRACEBACK_ERROR_MARK: &str = "traceback.error_mark";
    pub const TRACEBACK_FILENAME: &str = "traceback.filename";
    pub const TRACEBACK_LINE_NO: &str = "traceback.line_no";
    pub const TRACEBACK_LOCALS_HEADER: &str = "traceback.locals_header";
    pub const TRACEBACK_LOCALS_KEY: &str = "traceback.locals_key";
    pub const TRACEBACK_LOCALS_VALUE: &str = "traceback.locals_value";
    pub const TRACEBACK_EXC_TYPE: &str = "traceback.exc_type";
    pub const TRACEBACK_EXC_VALUE: &str = "traceback.exc_value";

    // general
    pub const RULE_LINE: &str = "rule.line";
    pub const RULE_TEXT: &str = "rule.text";
    pub const BAR_COMPLETE: &str = "bar.complete";
    pub const BAR_FINISHED: &str = "bar.finished";
    pub const BAR_PULSE: &str = "bar.pulse";
    pub const BAR_REMAINING: &str = "bar.remaining";
    pub const PROGRESS_DESCRIPTION: &str = "progress.description";
    pub const PROGRESS_PERCENTAGE: &str = "progress.percentage";
    pub const PROGRESS_REMAINING: &str = "progress.remaining";
    pub const PROGRESS_ELAPSED: &str = "progress.elapsed";
    pub const PROGRESS_DATA: &str = "progress.data";
    pub const PROGRESS_DOWNLOAD: &str = "progress.download";
    pub const PROGRESS_TRANSFER: &str = "progress.transfer";
    pub const PROGRESS_FILESIZE: &str = "progress.filesize";
    pub const PROGRESS_TOTAL: &str = "progress.total";
    pub const TREE: &str = "tree";
    pub const TREE_LINE: &str = "tree.line";
    pub const MARKDOWN_H1: &str = "markdown.h1";
    pub const MARKDOWN_H2: &str = "markdown.h2";
    pub const MARKDOWN_CODE: &str = "markdown.code";
    pub const MARKDOWN_LINK: &str = "markdown.link";
    pub const MARKDOWN_ITEM: &str = "markdown.item";
    pub const MARKDOWN_H3: &str = "markdown.h3";
    pub const MARKDOWN_H4: &str = "markdown.h4";
    pub const MARKDOWN_H5: &str = "markdown.h5";
    pub const MARKDOWN_H6: &str = "markdown.h6";
    pub const MARKDOWN_H7: &str = "markdown.h7";
    pub const MARKDOWN_PARAGRAPH: &str = "markdown.paragraph";
    pub const MARKDOWN_BLOCKQUOTE: &str = "markdown.blockquote";
    pub const MARKDOWN_LIST: &str = "markdown.list";
    pub const MARKDOWN_ITEM_BULLET: &str = "markdown.item.bullet";
    pub const MARKDOWN_ITEM_NUMBER: &str = "markdown.item.number";
    pub const MARKDOWN_TABLE: &str = "markdown.table";
    pub const MARKDOWN_TABLE_HEADER: &str = "markdown.table.header";
    pub const MARKDOWN_CODE_BLOCK: &str = "markdown.code.block";
    pub const MARKDOWN_CODE_INLINE: &str = "markdown.code.inline";
    pub const MARKDOWN_HR: &str = "markdown.hr";
    pub const JSON_KEY: &str = "json.key";
    pub const JSON_STR: &str = "json.str";
    pub const JSON_NUMBER: &str = "json.number";
    pub const JSON_BOOL: &str = "json.bool";
    pub const JSON_NULL: &str = "json.null";
    pub const JSON_BOOL_TRUE: &str = "json.bool_true";
    pub const JSON_BOOL_FALSE: &str = "json.bool_false";
    pub const JSON_BRACE: &str = "json.brace";

    // status
    pub const STATUS_SPINNER: &str = "status.spinner";
    pub const STATUS_MESSAGE: &str = "status.message";

    // prompt
    pub const PROMPT: &str = "prompt";
    pub const PROMPT_CHOICES: &str = "prompt.choices";
    pub const PROMPT_DEFAULT: &str = "prompt.default";

    // syntax highlighting (via syntect)
    pub const SYNTAX_COMMENT: &str = "syntax.comment";
    pub const SYNTAX_KEYWORD: &str = "syntax.keyword";
    pub const SYNTAX_STRING: &str = "syntax.string";
    pub const SYNTAX_NUMBER: &str = "syntax.number";
    pub const SYNTAX_FUNCTION: &str = "syntax.function";
    pub const SYNTAX_TYPE: &str = "syntax.type";
}

/// Create the default Rich-like theme.
pub fn default_theme() -> Theme {
    let mut t = Theme::new();
    use crate::color::Color;
    use crate::style::Style;

    // repr styles
    t.set(
        names::REPR_NUMBER,
        Style::new().color(Color::parse("cyan").unwrap()).bold(true),
    );
    t.set(
        names::REPR_STR,
        Style::new().color(Color::parse("green").unwrap()),
    );
    t.set(
        names::REPR_BOOL_TRUE,
        Style::new()
            .color(Color::parse("bright_green").unwrap())
            .bold(true),
    );
    t.set(
        names::REPR_BOOL_FALSE,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .bold(true),
    );
    t.set(
        names::REPR_NONE,
        Style::new()
            .color(Color::parse("bright_yellow").unwrap())
            .dim(true),
    );
    t.set(
        names::REPR_URL,
        Style::new()
            .color(Color::parse("bright_blue").unwrap())
            .underline(true),
    );
    t.set(
        names::REPR_PATH,
        Style::new().color(Color::parse("magenta").unwrap()),
    );
    t.set(
        names::REPR_ATTRIB_NAME,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::REPR_ATTRIB_VALUE,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::REPR_ELLIPSIS,
        Style::new().dim(true).color(Color::parse("white").unwrap()),
    );
    t.set(
        names::REPR_IPV4,
        Style::new()
            .color(Color::parse("bright_blue").unwrap())
            .bold(true),
    );
    t.set(
        names::REPR_IPV6,
        Style::new()
            .color(Color::parse("bright_magenta").unwrap())
            .bold(true),
    );
    t.set(
        names::REPR_TAG_NAME,
        Style::new()
            .color(Color::parse("bright_blue").unwrap())
            .bold(true),
    );
    t.set(
        names::REPR_TAG_CONTENTS,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::REPR_TAG_PUNCTUATION,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::REPR_BRACE,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::REPR_CALL,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::REPR_COMMA,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::REPR_BOOL,
        Style::new()
            .color(Color::parse("bright_yellow").unwrap())
            .bold(true),
    );
    t.set(
        names::REPR_ERROR,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .bold(true),
    );

    // table styles
    t.set(
        names::TABLE_HEADER,
        Style::new()
            .bold(true)
            .color(Color::parse("white").unwrap()),
    );
    t.set(names::TABLE_FOOTER, Style::new().bold(true));
    t.set(names::TABLE_TITLE, Style::new().bold(true));
    t.set(names::TABLE_CAPTION, Style::new().dim(true));
    t.set(
        names::TABLE_BORDER,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::TABLE_CELL,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::TABLE_ROW,
        Style::new().color(Color::parse("white").unwrap()),
    );

    // rule
    t.set(
        names::RULE_LINE,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(names::RULE_TEXT, Style::new().bold(true));

    // tree
    t.set(
        names::TREE,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::TREE_LINE,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );

    // progress
    t.set(
        names::BAR_COMPLETE,
        Style::new().color(Color::parse("green").unwrap()),
    );
    t.set(
        names::BAR_FINISHED,
        Style::new().color(Color::parse("bright_green").unwrap()),
    );
    t.set(
        names::BAR_PULSE,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::PROGRESS_DESCRIPTION,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::PROGRESS_PERCENTAGE,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::PROGRESS_REMAINING,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::PROGRESS_ELAPSED,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::PROGRESS_DATA,
        Style::new().color(Color::parse("bright_blue").unwrap()),
    );
    t.set(
        names::PROGRESS_DOWNLOAD,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::PROGRESS_TRANSFER,
        Style::new().color(Color::parse("bright_magenta").unwrap()),
    );
    t.set(
        names::PROGRESS_FILESIZE,
        Style::new().color(Color::parse("bright_green").unwrap()),
    );
    t.set(
        names::PROGRESS_TOTAL,
        Style::new().color(Color::parse("bright_blue").unwrap()),
    );
    t.set(
        names::BAR_REMAINING,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );

    // markdown
    t.set(
        names::MARKDOWN_H1,
        Style::new()
            .bold(true)
            .color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::MARKDOWN_H2,
        Style::new().bold(true).color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::MARKDOWN_CODE,
        Style::new()
            .color(Color::parse("bright_yellow").unwrap())
            .bgcolor(Color::parse("black").unwrap()),
    );
    t.set(
        names::MARKDOWN_LINK,
        Style::new()
            .color(Color::parse("bright_blue").unwrap())
            .underline(true),
    );
    t.set(
        names::MARKDOWN_H3,
        Style::new()
            .bold(true)
            .color(Color::parse("yellow").unwrap()),
    );
    t.set(
        names::MARKDOWN_H4,
        Style::new()
            .bold(true)
            .color(Color::parse("green").unwrap()),
    );
    t.set(
        names::MARKDOWN_H5,
        Style::new().bold(true).color(Color::parse("blue").unwrap()),
    );
    t.set(
        names::MARKDOWN_H6,
        Style::new()
            .bold(true)
            .color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::MARKDOWN_H7,
        Style::new()
            .dim(true)
            .color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::MARKDOWN_PARAGRAPH,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::MARKDOWN_BLOCKQUOTE,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(
        names::MARKDOWN_LIST,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::MARKDOWN_ITEM,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::MARKDOWN_ITEM_BULLET,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::MARKDOWN_ITEM_NUMBER,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::MARKDOWN_TABLE,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::MARKDOWN_TABLE_HEADER,
        Style::new()
            .bold(true)
            .color(Color::parse("white").unwrap()),
    );
    t.set(
        names::MARKDOWN_CODE_BLOCK,
        Style::new()
            .color(Color::parse("bright_yellow").unwrap())
            .bgcolor(Color::parse("black").unwrap()),
    );
    t.set(
        names::MARKDOWN_CODE_INLINE,
        Style::new().color(Color::parse("bright_yellow").unwrap()),
    );
    t.set(
        names::MARKDOWN_HR,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );

    // json
    t.set(
        names::JSON_KEY,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::JSON_STR,
        Style::new().color(Color::parse("green").unwrap()),
    );
    t.set(
        names::JSON_NUMBER,
        Style::new()
            .color(Color::parse("bright_blue").unwrap())
            .bold(true),
    );
    t.set(
        names::JSON_BOOL,
        Style::new()
            .color(Color::parse("bright_yellow").unwrap())
            .bold(true),
    );
    t.set(
        names::JSON_NULL,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .dim(true),
    );
    t.set(
        names::JSON_BOOL_TRUE,
        Style::new()
            .color(Color::parse("bright_green").unwrap())
            .bold(true),
    );
    t.set(
        names::JSON_BOOL_FALSE,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .bold(true),
    );
    t.set(
        names::JSON_BRACE,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );

    // traceback
    t.set(
        names::TRACEBACK_BORDER,
        Style::new().color(Color::parse("red").unwrap()),
    );
    t.set(names::TRACEBACK_TITLE, Style::new().bold(true));
    t.set(
        names::TRACEBACK_ERROR,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .bold(true),
    );
    t.set(
        names::TRACEBACK_ERROR_MARK,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .bold(true),
    );
    t.set(
        names::TRACEBACK_FILENAME,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::TRACEBACK_LINE_NO,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );
    t.set(names::TRACEBACK_LOCALS_HEADER, Style::new().bold(true));
    t.set(
        names::TRACEBACK_LOCALS_KEY,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::TRACEBACK_LOCALS_VALUE,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::TRACEBACK_EXC_TYPE,
        Style::new()
            .color(Color::parse("bright_red").unwrap())
            .bold(true),
    );
    t.set(
        names::TRACEBACK_EXC_VALUE,
        Style::new().color(Color::parse("white").unwrap()),
    );

    // logging extras
    t.set(
        names::LOGGING_KEYWORD,
        Style::new()
            .color(Color::parse("bright_yellow").unwrap())
            .bold(true),
    );
    t.set(
        names::LOGGING_LEVEL_NOTSET,
        Style::new().dim(true).color(Color::parse("white").unwrap()),
    );

    // status & prompt
    t.set(
        names::STATUS_SPINNER,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::STATUS_MESSAGE,
        Style::new().color(Color::parse("white").unwrap()),
    );
    t.set(
        names::PROMPT,
        Style::new().color(Color::parse("bright_cyan").unwrap()),
    );
    t.set(
        names::PROMPT_CHOICES,
        Style::new().color(Color::parse("cyan").unwrap()),
    );
    t.set(
        names::PROMPT_DEFAULT,
        Style::new().color(Color::parse("bright_black").unwrap()),
    );

    t
}