Skip to content

Commit 23eea59

Browse files
committed
Release v0.4.0
1 parent 0e936fe commit 23eea59

File tree

4 files changed

+44
-50
lines changed

4 files changed

+44
-50
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
## [0.4.0] - 2020-05-03
99

1010
### Added
1111

@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- `$_ZO_ECHO` now only works when set to `1`.
2323
- Using the `--z-cmd` flag now also renames the associated aliases.
2424
- The `--z-cmd` flag has been renamed to `--cmd`.
25+
- The `--no-define-aliases` flag has been renamed to `--no-aliases`.
2526

2627
### Fixed
2728

@@ -120,6 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
120121
- GitHub Actions pipeline to build and upload releases.
121122
- Support for the `zsh` shell.
122123

124+
[0.4.0]: https://github.com/ajeetdsouza/zoxide/compare/v0.3.1...v0.4.0
123125
[0.3.1]: https://github.com/ajeetdsouza/zoxide/compare/v0.3.0...v0.3.1
124126
[0.3.0]: https://github.com/ajeetdsouza/zoxide/compare/v0.2.2...v0.3.0
125127
[0.2.2]: https://github.com/ajeetdsouza/zoxide/compare/v0.2.1...v0.2.2

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "zoxide"
3-
version = "0.3.1"
3+
version = "0.4.0"
44
authors = ["Ajeet D'Souza <[email protected]>"]
5-
description = "A cd command that learns your habits"
5+
description = "A faster way to navigate your filesystem"
66
repository = "https://github.com/ajeetdsouza/zoxide/"
77
edition = "2018"
88

README.md

+38-46
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![crates.io](https://img.shields.io/crates/v/zoxide)](https://crates.io/crates/zoxide)
44
![.github/workflows/release.yml](https://github.com/ajeetdsouza/zoxide/workflows/.github/workflows/release.yml/badge.svg)
55

6-
A cd command that learns your habits
6+
A faster way to navigate your filesystem
77

88
## Table of contents
99

@@ -12,10 +12,10 @@ A cd command that learns your habits
1212
- [Getting started](#getting-started)
1313
- [Installing `zoxide`](#step-1-installing-zoxide)
1414
- [Adding `zoxide` to your shell](#step-2-adding-zoxide-to-your-shell)
15-
- [zsh](#zsh)
1615
- [bash](#bash)
1716
- [fish](#fish)
18-
- [POSIX](#posix)
17+
- [POSIX](#posix-shells)
18+
- [zsh](#zsh)
1919
- [Configuration](#configuration)
2020
- [`init` flags](#init-flags)
2121
- [Environment variables](#environment-variables)
@@ -71,14 +71,6 @@ your existing database into `zoxide`:
7171
zoxide import /path/to/db
7272
```
7373

74-
#### zsh
75-
76-
Add the following line to your `~/.zshrc`:
77-
78-
```sh
79-
eval "$(zoxide init zsh)"
80-
```
81-
8274
#### bash
8375

8476
Add the following line to your `~/.bashrc`:
@@ -95,57 +87,57 @@ Add the following line to your `~/.config/fish/config.fish`:
9587
zoxide init fish | source
9688
```
9789

98-
#### POSIX
90+
#### POSIX shells
9991

10092
Add the following line to your shell's configuration file:
10193

10294
```sh
103-
eval "$(zoxide init posix)"
95+
eval "$(zoxide init posix --hook prompt)"
10496
```
10597

106-
NOTE: If you modify your `PS1` at any point, you may need to re-run the above command. This is due
107-
to the fact that the hook is stored in `PS1`, in order to be evaluated every time the prompt is
108-
displayed.
98+
The `prompt` hook is recommended for POSIX shells because the default `pwd`
99+
hook creates a temporary file for every session, which are only deleted upon
100+
reboot. If you do want to use `pwd` hooks instead, you may want to set up traps
101+
to perform a cleanup once the shell exits:
109102

110-
NOTE: PWD hooks are currently not supported for POSIX shells.
103+
```sh
104+
trap '_zoxide_cleanup' EXIT HUP KILL TERM
105+
trap '_zoxide_cleanup; trap - INT; kill -s INT "$$"' INT
106+
trap '_zoxide_cleanup; trap - QUIT; kill -s QUIT "$$"' QUIT
107+
```
108+
109+
NOTE: If you modify your `PS1` at any point, you may need to re-run the above
110+
command. This is due to the fact that the hook is stored in `PS1`, in order to
111+
be evaluated every time the prompt is displayed.
112+
113+
#### zsh
114+
115+
Add the following line to your `~/.zshrc`:
116+
117+
```sh
118+
eval "$(zoxide init zsh)"
119+
```
111120

112121
## Configuration
113122

114123
### `init` flags
115124

116-
- `--hook <HOOK>`: change the event that adds a new entry to the database (default: `prompt`)
117-
- `none`: never add entries (this will make `zoxide` useless unless you manually configure a hook)
125+
- `--cmd`: change the `z` command (and corresponding aliases) to something else
126+
- `--hook <HOOK>`: change the event that adds a new entry to the database
127+
(default: `pwd`)
128+
- `none`: never add entries
129+
(this will make `zoxide` useless unless you manually configure a hook)
118130
- `prompt`: add an entry at every prompt
119-
- `pwd`: add an entry whenever you change directories
120-
- `--no-define-aliases`: don't define extra aliases like `zi`, `zq`, `za`, and `zr`
121-
- `--z-cmd`: rename the `z` command to something else
131+
- `pwd`: add an entry whenever the current directory is changed
132+
- `--no-aliases`: don't define extra aliases like `zi`, `zq`, `za`, and `zr`
122133

123134
### Environment variables
124135

125-
- `$_ZO_DATA_DIR`: directory where `zoxide` will store its data files (default:
126-
platform-specific; see the [`dirs` documentation] for more information)
127-
- `$_ZO_ECHO`: `z` will print the matched directory before navigating to it
128-
- `$_ZO_EXCLUDE_DIRS`: list of directories separated by platform-specific
129-
characters ("`:`" on Linux and macOS, and "`;`" on Windows) to be excluded from
130-
the database
136+
- `$_ZO_DATA_DIR`: directory where `zoxide` will store its data files
137+
(default: platform-specific; see the [`dirs` documentation] for more information)
138+
- `$_ZO_ECHO`: when set to `1`, `z` will print the matched directory before navigating to it
139+
- `$_ZO_EXCLUDE_DIRS`: list of directories separated by platform-specific characters
140+
("`:`" on Linux/macOS, "`;`" on Windows) to be excluded from the database
131141
- `$_ZO_MAXAGE`: sets the maximum total rank after which entries start getting deleted
132142

133143
[`dirs` documentation]: https://docs.rs/dirs/latest/dirs/fn.data_local_dir.html
134-
135-
## Notes
136-
137-
If you recently updated `zoxide` from an older version to `v0.3` and are
138-
seeing the following error:
139-
140-
```
141-
Error: could not deserialize old database
142-
143-
Caused by:
144-
io error: failed to fill whole buffer
145-
```
146-
147-
It is because v0.2 and v0.3 databases are incompatible. There is a script to
148-
automatically migrate your database to the new format, but it seems to be
149-
failing on some systems.
150-
151-
For a quick fix, you can try removing the old database file: `rm ~/.zo`

0 commit comments

Comments
 (0)