summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2019-02-10 16:30:42 +0100
committerCanop <cano.petrole@gmail.com>2019-02-10 16:30:42 +0100
commit80b5b91a4fec8dce99291a484e9eaa90c984b26b (patch)
tree9c460c313bf9b9943a618759440f8baebf2677d5 /README.md
parentbda6c1009a52eaa029c5bb81347366bab9f3605b (diff)
documentation no longer asks for a manual installation of br
Diffstat (limited to 'README.md')
-rw-r--r--README.md37
1 files changed, 5 insertions, 32 deletions
diff --git a/README.md b/README.md
index dbc6913..35fac3b 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ Most useful keys for this:
* the letters of what you're looking for
* `<enter>` to select a directory (staying in broot)
* `<esc>` to get back to the previous state or clear your search
-* `<alt><enter>` to get back to the shell having `cd` to the selected directory ([see below](#use-broot-for-navigation))
+* `<alt><enter>` to get back to the shell having `cd` to the selected directory
* `:q` if you just want to quit (`<esc>` works too)
### Never lose track of file hierarchy while you fuzzy search:
@@ -82,42 +82,15 @@ The executable is written in the `target/release` directory (you might want to m
* [x86_64-linux](https://dystroy.org/broot/x86_64-linux/broot)
-## cd
+### Installation Completion : the `br` shell function
broot is convenient to find a directory then `cd` to it, which is done using `<alt><enter>` or `:cd`.
-But broot needs a companion function in the shell in order to be able to change directory. To enable this feature, add this to your `.bashrc` (or the relevant file for another shell):
+But broot needs a companion function in the shell in order to be able to change directory.
- # start broot and let it change directory
- function br {
- f=$(mktemp)
-
- (
- set +e
- broot --out "$f" "$@"
- code=$?
- if [ "$code" != 0 ]; then
- rm -f "$f"
- exit "$code"
- fi
- )
- code=$?
- if [ "$code" != 0 ]; then
- return "$code"
- fi
-
- d=$(cat "$f")
- rm -f "$f"
-
- if [ "$(wc -c <(echo -n "$d") | head -c1)" != 0 ]; then
- cd "$d"
- fi
- }
-
-(You'll have to source the `.bashrc` file or open a new terminal for the function to take effect.)
-
-With this addition, you can do just `br` to launch broot, and typing `<alt><enter>` will cd for you.
+To enable this feature, broot asks the permission to register this shell function on first run.
+When it's done, you can do just `br` to launch broot, and typing `<alt><enter>` will cd for you.
## Development