lsd does not exit on closed pipes
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 510
- PR merge metrics
- No merged PRs in 30d
Description
- os:
- `lsd --version`: lsd 0.21.0
- `echo $TERM`: xterm-256color
- `echo $LS_COLORS`:
```
zsh: correct '$LS_COLORS' to '$LSCOLORS' [nyae]? y
Gxfxcxdxbxegedabagacad
```
## Expected behavior
When piping to a program that exist, `lsd` will continue running until reading (all) paths is done. This is a problem when using the recursive flag, as `lsd` will recurse all directories than exit.
```bash
lsd -lR / | bash -c 'exit'
```: This command will go on until all paths are consumed, which takes a lot of time and memory.
```bash
/bin/ls -lR / | bash -c 'exit'
```: This command exits in less than a second.
## Actual behavior
Noted above
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with `lsd -lR / | bash -c 'exit'` and compare its termination with `/bin/ls -lR / | bash -c 'exit'`. Trace the Rust CLI's handling of output and closed pipes; done means lsd stops promptly when the downstream program exits, including recursive listings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100