Most notably, this adds instructions of changing $_Z_CD. I think many
`fish` users would find them useful.
See https://github.com/skywind3000/z.lua/pull/131 for more background.
This makes the installation instructions more conventional (`|source`
instead of `psub`). This also deletes the second (equivalent) set of instructions.
If the warning in that sentence is important, we could add it back, but
it would apply to all the shells, wouldn't it?
Finally, some wording is improved.
I don't know if the default of `builtin cd` is a good one, as opposed to simple `cd`. It took me quite a bit of debugging before I figured out why, on my `fish` shell, changing directories with `z.lua` messed up the `cdh` (cd history) command.
I think the best thing would be to change the default. However, if you have a good reason to stick with it, I thought that documenting this potentially unexpected behavior might help.
Originally `z foo` printed a blank line after the command. My recent
change accidentally changed how CMD interpreted the end of the file such
that CMD stopped printing the blank line. This change adjusts the end
of the file to once again cause CMD to print a blank line on finish.
`z somedir` uses double `pushd` to tunnel the new path out past the
endlocal that restores the environment state. But it ended up leaving
a pushd on the dir stack.
This change exploits normal variable expansion to restore the dir stack
to its initial state while still successfully tunneling the new path out
past the endlocal.
`z -I` had 2 issues:
- it used `subprocess.check_output()`, but didn't UTF-8 decode the string (like the `if mode` statement's `else` branch does on row 80)
- it wasn't actually interactive, like `-I` is supposed to be (subprocess.check_output()` is not interactive)
I'm not sure why `-I` mode was originally treated differently from e.g. `-i` mode, but the same code works for both.
I took the `redraw_window` console command from the original `-I` mode code, because without it the screen updates a bit slower, causing an ugly "flash".