Canop / Canop/broot

Broken first-run init configuration when path to config dir contains a space

Open
#520 10 comments 1 reaction 0 assignees View on GitHub
bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.