diskonaut leaves terminal unclean if non-existing dir
- Dominant language
- Rust
- Stars
- 3.1k
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
When running diskonaut on a non-existing dir, it exits with an error and leaves the terminal in an unclean state. When running for example "ls" after it, the columns are not aligned as they were before running diskonaut:
```
% ls
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49
2 5 8 11 14 17 20 23 26 29 32 35 38 41 44 47 50
3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48
% diskonaut non-existing
Error: Folder 'non-existing' does not exist
% % ls
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49
2 5 8 11 14 17 20 23 26 29 32 35 38 41 44 47 50
3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48
% %
```
and BTW, when diskonaut exits cleanly, the terminal is not garbled, but no newline is emitted at the end (after some real characters are left), which not be reacted well to by shells
Contributor guide
Research direction
Reproduce the failure with `diskonaut non-existing` and compare the terminal state before and after the error. Trace the error-exit and clean-exit paths in the Rust CLI, then verify that both restore terminal formatting and emit a final newline where needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100