Broken first-run init configuration when path to config dir contains a space
- Dominant language
- Rust
- Stars
- 12.9k
- Forks
- 314
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 6
Description
Automated initial patch for shell config(`.bashrc`, .`.zshrc`,..) is broken because path to `br` fn isn't sanitised.
Steps to reproduce:
1. run `cargo install broot`
2. run `broot`
3. Broot will ask:
```
Broot should be launched using a shell function...
Can I install it now? [Y/n]
```
- `y`
4. > `~/.zshrc` successfully patched
5. look at you punched config (`~/.zshrc`)
6. There's path with spaces.
### Actual result:
```
source /Users/ak/Library/Application Support/org.dystroy.broot/launcher/bash/br
```
Expected result:
```
source /Users/ak/Library/Application\ Support/org.dystroy.broot/launcher/bash/br
```
Contributor guide
Research direction
Start by reproducing the first-run shell configuration setup with a configuration-directory path containing spaces, then trace the code that generates the shell function source line. Verify the generated `.bashrc` or `.zshrc` entry against the escaped path shown in the expected result; done means the launcher path works when sourced.
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