droidtui 0.2.6

A beautiful Terminal User Interface (TUI) for Android development and ADB commands
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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
// Removed unused import: get_menu_border_color
use ratatui::{
    buffer::Buffer,
    layout::{Alignment, Constraint, Direction, Layout, Rect},
    style::{Color, Modifier, Style},
    text::{Line, Span},
    widgets::{Block, List, ListItem, ListState, Paragraph, Widget},
};

#[derive(Debug, Clone)]
pub struct MenuItem {
    pub label: String,
    pub description: String,
    pub command: String,
    pub children: Vec<MenuChild>,
}

#[derive(Debug, Clone)]
pub struct MenuChild {
    pub label: String,
    pub description: String,
    pub command: String,
}

#[derive(Debug)]
pub struct Menu {
    pub items: Vec<MenuItem>,
    pub state: ListState,
    pub selected: usize,
    pub tick_count: u64,
    pub last_selected: usize,
    pub position_change_boost: u64,
    pub in_child_mode: bool,
    pub child_selected: usize,
    pub child_state: ListState,
}

impl Default for Menu {
    fn default() -> Self {
        let items = vec![
            MenuItem {
                label: "📱 List Devices".to_string(),
                description: "Show all connected Android devices with their status".to_string(),
                command: "adb devices -l".to_string(),
                children: vec![
                    MenuChild {
                        label: "📋 List Connected Devices".to_string(),
                        description: "Show basic device list".to_string(),
                        command: "adb devices".to_string(),
                    },
                    MenuChild {
                        label: "📝 Detailed Device Info".to_string(),
                        description: "Show devices with detailed information".to_string(),
                        command: "adb devices -l".to_string(),
                    },
                    MenuChild {
                        label: "🔍 Device Serial Numbers".to_string(),
                        description: "List only device serial numbers".to_string(),
                        command: "adb devices | grep -v 'List of devices' | awk '{print $1}'".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "📋 List Packages".to_string(),
                description: "List all installed packages on the device".to_string(),
                command: "adb shell pm list packages -f".to_string(),
                children: vec![
                    MenuChild {
                        label: "📦 All Packages".to_string(),
                        description: "List all installed packages".to_string(),
                        command: "adb shell pm list packages".to_string(),
                    },
                    MenuChild {
                        label: "📁 Packages with Paths".to_string(),
                        description: "List packages with file paths".to_string(),
                        command: "adb shell pm list packages -f".to_string(),
                    },
                    MenuChild {
                        label: "👤 User Packages Only".to_string(),
                        description: "List only user-installed packages".to_string(),
                        command: "adb shell pm list packages -3".to_string(),
                    },
                    MenuChild {
                        label: "⚙️ System Packages Only".to_string(),
                        description: "List only system packages".to_string(),
                        command: "adb shell pm list packages -s".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "🔋 Battery Info".to_string(),
                description: "Display detailed battery information".to_string(),
                command: "adb shell dumpsys battery".to_string(),
                children: vec![
                    MenuChild {
                        label: "🔋 Full Battery Status".to_string(),
                        description: "Complete battery information".to_string(),
                        command: "adb shell dumpsys battery".to_string(),
                    },
                    MenuChild {
                        label: "⚡ Battery Level".to_string(),
                        description: "Show just battery percentage".to_string(),
                        command: "adb shell dumpsys battery | grep level".to_string(),
                    },
                    MenuChild {
                        label: "🔌 Charging Status".to_string(),
                        description: "Show charging state".to_string(),
                        command: "adb shell dumpsys battery | grep 'AC powered\\|USB powered\\|status'".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "💾 Memory Usage".to_string(),
                description: "Show memory usage statistics".to_string(),
                command: "adb shell dumpsys meminfo".to_string(),
                children: vec![
                    MenuChild {
                        label: "📊 System Memory".to_string(),
                        description: "Overall system memory usage".to_string(),
                        command: "adb shell dumpsys meminfo".to_string(),
                    },
                    MenuChild {
                        label: "📱 Available Memory".to_string(),
                        description: "Show available memory".to_string(),
                        command: "adb shell cat /proc/meminfo | grep -E 'MemTotal|MemFree|MemAvailable'".to_string(),
                    },
                    MenuChild {
                        label: "🔝 Top Memory Apps".to_string(),
                        description: "Apps using most memory".to_string(),
                        command: "adb shell 'dumpsys meminfo | grep -E \"(Total|TOTAL)\" | head -10'".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "📊 CPU Info".to_string(),
                description: "Display CPU information and usage".to_string(),
                command: "adb shell cat /proc/cpuinfo".to_string(),
                children: vec![
                    MenuChild {
                        label: "🔧 CPU Details".to_string(),
                        description: "Detailed CPU information".to_string(),
                        command: "adb shell cat /proc/cpuinfo".to_string(),
                    },
                    MenuChild {
                        label: "⚡ CPU Usage".to_string(),
                        description: "Top processes by CPU usage".to_string(),
                        command: "adb shell 'ps -eo PID,PPID,USER,COMM | head -20'".to_string(),
                    },
                    MenuChild {
                        label: "📈 Load Average".to_string(),
                        description: "System load average".to_string(),
                        command: "adb shell cat /proc/loadavg".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "🔗 Network Info".to_string(),
                description: "Show network connectivity information".to_string(),
                command: "adb shell dumpsys connectivity".to_string(),
                children: vec![
                    MenuChild {
                        label: "🌐 Connectivity Status".to_string(),
                        description: "Network connectivity details".to_string(),
                        command: "adb shell dumpsys connectivity".to_string(),
                    },
                    MenuChild {
                        label: "📶 WiFi Info".to_string(),
                        description: "WiFi connection details".to_string(),
                        command: "adb shell dumpsys wifi".to_string(),
                    },
                    MenuChild {
                        label: "🔗 IP Configuration".to_string(),
                        description: "Network interface configuration".to_string(),
                        command: "adb shell ip addr show".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "📱 Device Properties".to_string(),
                description: "Get all device system properties".to_string(),
                command: "adb shell getprop".to_string(),
                children: vec![
                    MenuChild {
                        label: "📋 All Properties".to_string(),
                        description: "Show all system properties".to_string(),
                        command: "adb shell getprop".to_string(),
                    },
                    MenuChild {
                        label: "🏷️ Device Model".to_string(),
                        description: "Show device model and brand".to_string(),
                        command: "adb shell getprop | grep -E 'ro.product.model|ro.product.brand|ro.product.name'".to_string(),
                    },
                    MenuChild {
                        label: "🔢 Android Version".to_string(),
                        description: "Show Android version info".to_string(),
                        command: "adb shell getprop | grep -E 'ro.build.version|ro.build.id'".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "🎯 Running Processes".to_string(),
                description: "List all running processes".to_string(),
                command: "adb shell ps -A".to_string(),
                children: vec![
                    MenuChild {
                        label: "📋 All Processes".to_string(),
                        description: "List all running processes".to_string(),
                        command: "adb shell ps -A".to_string(),
                    },
                    MenuChild {
                        label: "🔝 Top Processes".to_string(),
                        description: "Top 20 running processes".to_string(),
                        command: "adb shell 'ps -A | head -20'".to_string(),
                    },
                    MenuChild {
                        label: "👤 User Processes".to_string(),
                        description: "User application processes only".to_string(),
                        command: "adb shell \"ps -A | grep -v 'system' | grep -v 'root' | head -15\"".to_string(),
                    },
                    MenuChild {
                        label: "📊 Process Details".to_string(),
                        description: "Detailed process information with formatting".to_string(),
                        command: "adb shell \"echo 'PID    USER         COMMAND'; echo '---    ----         -------'; ps -A | awk '{printf \"%-6s %-12s %s\\n\", \\$2, \\$1, \\$9}' | head -20\"".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "📊 System Services".to_string(),
                description: "List all system services status".to_string(),
                command: "adb shell service list".to_string(),
                children: vec![
                    MenuChild {
                        label: "📋 All Services".to_string(),
                        description: "List all system services".to_string(),
                        command: "adb shell service list".to_string(),
                    },
                    MenuChild {
                        label: "🔧 Running Services".to_string(),
                        description: "Show only running services".to_string(),
                        command: "adb shell dumpsys activity services".to_string(),
                    },
                    MenuChild {
                        label: "📱 App Services".to_string(),
                        description: "Application services only".to_string(),
                        command: "adb shell dumpsys activity services | grep -A 5 'ServiceRecord'".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "📷 Screenshot".to_string(),
                description: "Take and save device screenshots".to_string(),
                command: "adb shell screencap -p /sdcard/screenshot.png && adb pull /sdcard/screenshot.png ./".to_string(),
                children: vec![
                    MenuChild {
                        label: "📸 Take Screenshot".to_string(),
                        description: "Take screenshot and save to current directory".to_string(),
                        command: "adb shell screencap -p /sdcard/screenshot.png && adb pull /sdcard/screenshot.png ./".to_string(),
                    },
                    MenuChild {
                        label: "📁 Screenshot to Device".to_string(),
                        description: "Take screenshot and keep on device".to_string(),
                        command: "adb shell screencap -p /sdcard/screenshot_$(date +%Y%m%d_%H%M%S).png".to_string(),
                    },
                    MenuChild {
                        label: "🖼️ View Screenshot Path".to_string(),
                        description: "Show where screenshots are saved".to_string(),
                        command: "adb shell ls -la /sdcard/screenshot*.png".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "🔄 Reboot Device".to_string(),
                description: "Reboot the connected device".to_string(),
                command: "adb reboot".to_string(),
                children: vec![
                    MenuChild {
                        label: "🔄 Normal Reboot".to_string(),
                        description: "Reboot device normally".to_string(),
                        command: "adb reboot".to_string(),
                    },
                    MenuChild {
                        label: "⚡ Fast Reboot".to_string(),
                        description: "Fast reboot (bootloader)".to_string(),
                        command: "adb reboot bootloader".to_string(),
                    },
                    MenuChild {
                        label: "🔧 Recovery Mode".to_string(),
                        description: "Reboot to recovery mode".to_string(),
                        command: "adb reboot recovery".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "📜 System Log".to_string(),
                description: "View recent system logs (last 100 lines)".to_string(),
                command: "adb logcat -d -t 100".to_string(),
                children: vec![
                    MenuChild {
                        label: "📜 Recent Logs".to_string(),
                        description: "Last 100 log entries".to_string(),
                        command: "adb logcat -d -t 100".to_string(),
                    },
                    MenuChild {
                        label: "🚨 Error Logs Only".to_string(),
                        description: "Show only error messages".to_string(),
                        command: "adb logcat -d *:E".to_string(),
                    },
                    MenuChild {
                        label: "⚠️ Warning and Error".to_string(),
                        description: "Show warnings and errors".to_string(),
                        command: "adb logcat -d *:W".to_string(),
                    },
                    MenuChild {
                        label: "🔄 Clear Logs".to_string(),
                        description: "Clear the log buffer".to_string(),
                        command: "adb logcat -c".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "🔍 ADB Version".to_string(),
                description: "Display ADB version information".to_string(),
                command: "adb version".to_string(),
                children: vec![
                    MenuChild {
                        label: "🔍 ADB Version".to_string(),
                        description: "Show ADB version".to_string(),
                        command: "adb version".to_string(),
                    },
                    MenuChild {
                        label: "🔧 ADB Help".to_string(),
                        description: "Show ADB help information".to_string(),
                        command: "adb help".to_string(),
                    },
                    MenuChild {
                        label: "📍 ADB Path".to_string(),
                        description: "Show where ADB is installed".to_string(),
                        command: "which adb".to_string(),
                    },
                ],
            },
            MenuItem {
                label: "🧪 Test Scrolling".to_string(),
                description: "Test command with long output to demonstrate scrolling".to_string(),
                command: "./test_long_output.sh".to_string(),
                children: vec![
                    MenuChild {
                        label: "📜 Long Output Test".to_string(),
                        description: "Generate long output to test scrolling".to_string(),
                        command: "./test_long_output.sh".to_string(),
                    },
                    MenuChild {
                        label: "📋 List Directory".to_string(),
                        description: "List current directory contents".to_string(),
                        command: "ls -la".to_string(),
                    },
                    MenuChild {
                        label: "🔍 Show Environment".to_string(),
                        description: "Display environment variables".to_string(),
                        command: "env".to_string(),
                    },
                    MenuChild {
                        label: "📏 Wide Content Test".to_string(),
                        description: "Test wide content and text wrapping".to_string(),
                        command: "./test_wide_output.sh".to_string(),
                    },
                ],
            },
        ];

        let mut state = ListState::default();
        state.select(Some(0));

        let mut child_state = ListState::default();
        child_state.select(Some(0));

        Self {
            items,
            state,
            selected: 0,
            tick_count: 0,
            last_selected: 0,
            position_change_boost: 0,
            in_child_mode: false,
            child_selected: 0,
            child_state,
        }
    }
}

impl Menu {
    pub fn new() -> Self {
        Self::default()
    }

    pub fn tick(&mut self) {
        self.tick_count += 1;

        // Reduce boost over time
        if self.position_change_boost > 0 {
            self.position_change_boost = self.position_change_boost.saturating_sub(1);
        }
    }

    pub fn next(&mut self) {
        if self.in_child_mode {
            let current_item = &self.items[self.selected];
            let i = if self.child_selected >= current_item.children.len() - 1 {
                0
            } else {
                self.child_selected + 1
            };
            self.child_selected = i;
            self.child_state.select(Some(i));
        } else {
            let i = match self.state.selected() {
                Some(i) => {
                    if i >= self.items.len() - 1 {
                        0
                    } else {
                        i + 1
                    }
                }
                None => 0,
            };
            self.state.select(Some(i));
            self.last_selected = self.selected;
            self.selected = i;

            // Add boost for position change
            if self.last_selected != self.selected {
                self.position_change_boost = 50; // Boost duration
            }
        }
    }

    pub fn previous(&mut self) {
        if self.in_child_mode {
            let current_item = &self.items[self.selected];
            let i = if self.child_selected == 0 {
                current_item.children.len() - 1
            } else {
                self.child_selected - 1
            };
            self.child_selected = i;
            self.child_state.select(Some(i));
        } else {
            let i = match self.state.selected() {
                Some(i) => {
                    if i == 0 {
                        self.items.len() - 1
                    } else {
                        i - 1
                    }
                }
                None => 0,
            };
            self.state.select(Some(i));
            self.last_selected = self.selected;
            self.selected = i;

            // Add boost for position change
            if self.last_selected != self.selected {
                self.position_change_boost = 50; // Boost duration
            }
        }
    }

    pub fn get_selected_item(&self) -> Option<&MenuItem> {
        self.items.get(self.selected)
    }

    pub fn get_selected_command(&self) -> Option<String> {
        if self.in_child_mode {
            if let Some(item) = self.items.get(self.selected) {
                item.children
                    .get(self.child_selected)
                    .map(|child| child.command.clone())
            } else {
                None
            }
        } else {
            self.items
                .get(self.selected)
                .map(|item| item.command.clone())
        }
    }

    pub fn enter_child_mode(&mut self) {
        if let Some(item) = self.items.get(self.selected) {
            if !item.children.is_empty() {
                self.in_child_mode = true;
                self.child_selected = 0;
                self.child_state.select(Some(0));
            }
        }
    }

    pub fn trigger_fade_in(&mut self) -> bool {
        // Return true if fade-in should be triggered
        self.in_child_mode
    }

    pub fn exit_child_mode(&mut self) {
        self.in_child_mode = false;
        self.child_selected = 0;
        self.child_state.select(Some(0));
    }

    pub fn is_in_child_mode(&self) -> bool {
        self.in_child_mode
    }
}

impl Widget for &Menu {
    fn render(self, area: Rect, buf: &mut Buffer) {
        // Split the area horizontally with a separator column
        let chunks = if self.in_child_mode {
            Layout::default()
                .direction(Direction::Horizontal)
                .margin(0)
                .constraints([
                    Constraint::Percentage(40),
                    Constraint::Length(1), // Separator
                    Constraint::Percentage(60),
                ])
                .split(area)
        } else {
            Layout::default()
                .direction(Direction::Horizontal)
                .margin(0)
                .constraints([
                    Constraint::Percentage(60),
                    Constraint::Length(1), // Separator
                    Constraint::Percentage(40),
                ])
                .split(area)
        };

        if self.in_child_mode {
            // Render parent menu (smaller)
            let parent_items: Vec<ListItem> = self
                .items
                .iter()
                .enumerate()
                .map(|(i, item)| {
                    let style = if i == self.selected {
                        Style::default()
                            .fg(Color::Yellow)
                            .add_modifier(Modifier::BOLD)
                    } else {
                        Style::default().fg(Color::DarkGray)
                    };
                    ListItem::new(Line::from(vec![Span::styled(item.label.clone(), style)]))
                })
                .collect();

            let parent_block = Block::default()
                .title("📂 Categories")
                .title_alignment(Alignment::Center)
                .style(Style::default().fg(Color::DarkGray));

            let parent_list = List::new(parent_items).block(parent_block);

            ratatui::widgets::StatefulWidget::render(
                parent_list,
                chunks[0],
                buf,
                &mut self.state.clone(),
            );

            // Render vertical separator
            for y in area.top()..area.bottom() {
                if let Some(cell) = buf.cell_mut((chunks[1].x, y)) {
                    cell.set_char('');
                    cell.set_fg(Color::DarkGray);
                }
            }

            // Render child menu (larger)
            if let Some(current_item) = self.items.get(self.selected) {
                let child_items: Vec<ListItem> = current_item
                    .children
                    .iter()
                    .enumerate()
                    .map(|(i, child)| {
                        let style = if i == self.child_selected {
                            Style::default()
                                .fg(Color::Black)
                                .bg(Color::Green)
                                .add_modifier(Modifier::BOLD)
                        } else {
                            Style::default().fg(Color::White)
                        };
                        ListItem::new(Line::from(vec![Span::styled(child.label.clone(), style)]))
                    })
                    .collect();

                let child_border_color = Color::Green;

                let child_block = Block::default()
                    .title(format!("{} Options", current_item.label))
                    .title_alignment(Alignment::Left)
                    .style(Style::default().fg(child_border_color));

                let child_list = List::new(child_items).block(child_block).highlight_style(
                    Style::default()
                        .fg(Color::Black)
                        .bg(Color::Green)
                        .add_modifier(Modifier::BOLD),
                );

                ratatui::widgets::StatefulWidget::render(
                    child_list,
                    chunks[2],
                    buf,
                    &mut self.child_state.clone(),
                );
            }
        } else {
            // Render main menu list
            let items: Vec<ListItem> = self
                .items
                .iter()
                .enumerate()
                .map(|(i, item)| {
                    let style = if i == self.selected {
                        Style::default()
                            .fg(Color::Black)
                            .bg(Color::Green)
                            .add_modifier(Modifier::BOLD)
                    } else {
                        Style::default().fg(Color::White)
                    };

                    let label_with_indicator = if item.children.is_empty() {
                        item.label.clone()
                    } else {
                        format!("{}", item.label)
                    };

                    ListItem::new(Line::from(vec![Span::styled(label_with_indicator, style)]))
                })
                .collect();

            let menu_border_color = Color::Green;

            let menu_block = Block::default()
                .title("📱 ADB Commands")
                .title_alignment(Alignment::Left)
                .style(Style::default().fg(menu_border_color));

            let menu_list = List::new(items).block(menu_block).highlight_style(
                Style::default()
                    .fg(Color::Black)
                    .bg(Color::Green)
                    .add_modifier(Modifier::BOLD),
            );

            ratatui::widgets::StatefulWidget::render(
                menu_list,
                chunks[0],
                buf,
                &mut self.state.clone(),
            );

            // Render vertical separator
            for y in area.top()..area.bottom() {
                if let Some(cell) = buf.cell_mut((chunks[1].x, y)) {
                    cell.set_char('');
                    cell.set_fg(Color::DarkGray);
                }
            }

            // Render description panel with dynamic styling
            if let Some(selected_item) = self.get_selected_item() {
                let desc_color = Color::DarkGray;

                let description_block = Block::default()
                    .title("│ Description")
                    .title_alignment(Alignment::Left)
                    .style(Style::default().fg(desc_color));

                let help_text = if selected_item.children.is_empty() {
                    "💡 Use ↑/↓ to navigate | ⏎ Enter to execute | q/Esc to quit"
                } else {
                    "💡 Use ↑/↓ to navigate | ⏎ Enter for options | q/Esc to quit"
                };

                let description_text = format!(
                    "{}\n\n🔧 Command:\n{}\n\n{}",
                    selected_item.description, selected_item.command, help_text
                );

                let description = Paragraph::new(description_text)
                    .block(description_block)
                    .style(Style::default().fg(Color::White))
                    .alignment(Alignment::Left)
                    .wrap(ratatui::widgets::Wrap { trim: true });

                description.render(chunks[2], buf);
            }
        }
    }
}