Commit 6d0af4b
authored
feat(tui): add shortcut for clearing task logs (#10828)
### Description
I use turborepo for long running `dev` tasks and sometimes I want to
clear the output of just one pane, for example server logs before
triggering a request.
If I clear my terminal buffer it clears everything including the TUI,
and the content is still there to be scrolled to. What I really want is
to only clear the logs for a single task.
This PR introduces the "Clear logs" option, currently bound to `shift-c`
(I tried to pick a shortcut inkeeping with the others). It clears the
logs only for the current task
Example screencasts below
### Testing Instructions
- Run some tasks with the `--ui=tui`
- Press `shift-c` on a pane with output
- See that only that panes output is cleared, and new logs appear as
normal
I attempted to write tests for this but I wasn't keen on all the hoops I
had to jump through to try and test that it actually clears the buffer
**Examples**
Attempting and failing to clear with cmd+k:
https://github.com/user-attachments/assets/d72a304d-c4b8-467b-9c17-16422552610e
New behaviour with shift-c:
https://github.com/user-attachments/assets/00440758-aa16-402f-9119-086639f4fb621 parent b2d47bc commit 6d0af4b
5 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
608 | 614 | | |
609 | 615 | | |
610 | 616 | | |
| |||
899 | 905 | | |
900 | 906 | | |
901 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
902 | 911 | | |
903 | 912 | | |
904 | 913 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
173 | 180 | | |
0 commit comments