This includes some improvements by @indrajitr in addition to the main migration.
The first step was to avoid PROMPT and RPROMPT modification when possible (which may help resolve some other issues as well relating to zsh crashes with the sorin prompt) then update the displayed git information in a separate variable rather than a command.
We use zsh-async for creating and running background tasks. The sorin prompt uses it to update git info without blocking the prompt from displaying (because of how long it can take). In the future it may be worth moving more tasks and more prompts to using this.
The move to zsh-async does make the git prompt slower in some circumstances (most noticeable in large repos), but this is a worthwhile tradeoff to avoid the cache file which had a number of potential security holes.
We have also switched to adding zsh-async as an external submodule (rather than the version bundled with pure) which may cause some migration headaches, but it will be worth it in the long run.
Previously I made a change to try and bind these unbound keys to the main
keymap in thoughts that in vicmd or viins mode it would fallback if it wasn't
bound in vicmd/viins mode. This turned out not to be the case.
Explicitly bind the keys in both viins and vicmd mode as works properly.
Changes:
- Rename `rsync_scp_wrap` to `noremoteglob` and make it more generally usable
- Enable completion support for commands wrapped with `noremoteglob`
- Tighten up internal variable usages
- Update documentation for 'noremoteglob' function
Changes:
* In prezto, function names are hyphenated ('-') by convention,
rename `promptpwd` to `prompt-pwd` accordingly.
* Unset local variable `current_pwd` proactively.
* Tweak additional documentation for `prompt-pwd`.
We cannot always assume availability of `pip`, it can be `pip2` or `pip3`
instead. We detect the first available one and use it for generating the
completion cache.
If you are in a tmux session, and auto-start is enabled
Then you `sudo su` and then `su <username>` it will re-attach, in a loop.
This resolves that problem, by forcing a detach before a (re)attach.
With editors that support it it will setup preferences so that it
will use 2 spaces as the indent, except in .gitignore and .gitmodules
which in our files use tabs.
For more info see http://EditorConfig.org
Currently rm/cp/ln/mv are aliased to rm/cp/ln/mv -i so that it will
prompt before removing files.
Some people would not like this functionality and wish for an easy way to
disable it. This adds a new option:
zstyle ':prezto:module:utility' safe-ops yes/no
It is enabled by default even if zstyle is not set, but can be set to no
to disable these aliases.
This should resolve issue #205
Somewhere around zsh 5.1, there was a change which turned typeset (and
most likely local) into a keyword. In older versions of zsh, using
`local x=()` will cause the () to be treated as a glob qualifier.
Fixes#1373
Usage of `(( ... ))` over `[[ ... ]]` is preferred for arithmetic expression
since the former is less error prone.
Also, unset local variable whenever possible.
Bind the remaining unbound keys in the main mode so that they
don't result in undefined functionality when pressed. (Often this
will change the casing of one/most/all of the characters you've
typed or even stranger things). In emacs mode this usually just
inserts a tilde, but this will fix that as well so nothing happens
when unbound keys are pressed.
Since there isn't any binding which does "nothing", create a noop
ZLE widget and bind them to that.
The user or other modules are still able to override these bindings
either by overriding the main keymap or setting a keymap in one
of the other modes which will take precedence over the main fallback.
Changes:
- Use git.io over 'https'
- Add extra check to conform to *.github.com URLs
- Use built-in _urls function for completion
- Update readme with GitHub blog URL
* [editor] Add bindkey-all function to show all bound keys
Function which allows you to see all the bound keys for all of
the different keymaps. It does accept arguments and passes them
through to bindkey -m "$keymap" so you could set a shortcut to
all keymaps as well if you wished.
Makes it much easier to see and grep what keys are bound to each of
the different keymaps.
When no arguments are given it will print keymap headers to stderr,
if given arguments it will not print anything extra to the screen.
* [editor] Update README to include information about bindkey-all funct.
Escape all $ except the first $. Escape all backtick `'s. This prevents
variable names or shell expansions placed as branch names from
remotely exploiting code.
Fixes issue #1267 for sorin prompt.
Adds a function which wraps rsync and scp so that remote paths are not globbed
but local paths are globbed. This is because the programs have their own
globbing for remote paths. The wrap function globs args starting in / and ./
and doesn't glob paths with : in it as these are interpreted as remote paths
by these programs unless the path starts with / or ./
Fixes issue #1125
* [zprezto-update] Add convenience function to update zprezto
This function checks if there is any update to zprezto, and if so
will pull in the changes. It will not attempt a pull unless
it is fastforwardable. It also makes sure the user is on the master
branch before attempting.
* [zprezto-update] Improve resilience of the function
Better error checking of status of the git repository
and better error producing.
Fit columns into mostly 80 width and add a missing printf
argument.
Use ( ) around the function so changing directory does not affect
the outer scope.
* [README] Add instructions on using zprezto-update function
In some cases TMPDIR may not be set, in which case it could cause issues
for zsh modules.
This change was prompted by issue #1331.
Also when creating a missing TMPDIR, use mkdir --mode=700 instead
of creating the directory and then chmoding it afterward.