This commit fixes an issue with themes on OS X which are sometimes
left in a partially broken environment with missing dependencies.
When a `BASH_IT_THEME` is active on OS X and has a
dynamic `PROMPT_COMMAND` which is not exported, and such
`PROMPT_COMMAND` is backed by shell functions which are not
exported either, and at the same time the theme is not
OS-X-aware (regarding `update_terminal_cwd`), and the
user launches a (non-login) interactive subshell from
the OS X Terminal, a `command not found` appears on every
command invocation.
The issue is caused by a regression in PR #514, which attempts to
inject `update_terminal_cwd` into the prompt. As a side effect, it
also escalates the exportedness of `PROMPT_COMMAND` while the
theme-specific backing functions (which power the dynamic prompt)
remain unexported.
The subshell cannot recover from this partially broken environment
because unlike in Linux, Bash-it on OS X is not invoked for non-login
subshells. The dependencies remain broken which leads to the error.
The fix is to preserve `PROMPT_COMMAND`’s exportedness on OS X,
leaving the individual theme responsible for consistently
exporting either all or nothing of its environment.
Avoiding the if statements, using exit code of `grep -q` instead.
Reverted the change that adds a space after the AC char. Opting for a
default value, allowing to override from one's profile.
See https://github.com/wting/autojump for more details.
Currently only supports the version installed through Homebrew on OS X.
Please feel free to provide a PR for supporting additional installation
options.
There are multiple ways to install fasd, but the initialization
still needs to happen. Currently, fasd is broken in bash in that
it doesn't maintain the exit code properly. This custom init removes
the call to `fasd --init bash-hook` and replaces it with the version
that would be generated once fasd PR #72 is merged.
See: https://github.com/clvv/fasd/pull/72
The update_terminal_cmd is interfering with the $? variable. Somehow it
is always 0.
```
caesium@Mac:~/Documents/projects/git/bash-it 0 >export
PROMPT_COMMAND="update_terminal_cwd;set_prompt"
caesium@Mac:~/Documents/projects/git/bash-it 0 >false
caesium@Mac:~/Documents/projects/git/bash-it 0 >true
caesium@Mac:~/Documents/projects/git/bash-it 0 >export
PROMPT_COMMAND="set_prompt;update_terminal_cwd"
caesium@Mac:~/Documents/projects/git/bash-it 0 >false
caesium@Mac:~/Documents/projects/git/bash-it 1 >true
caesium@Mac:~/Documents/projects/git/bash-it 0 >
```
After the fix it is working properly.
The `~` caused docker commands to error with the following:
```
$ docker images
Could not read CA certificate "~/.docker/machine/machines/dev/ca.pem"
```
Switching to $HOME fixes the issue
This plugin adds completion to aliases, just as with their regular
commands. Example:
* Completion works for `git checkout <TAB>`, which shows available
branches.
* You have an alias like `alias gco="git checkout"`
* The plugin adds support for `gco <TAB>`, which will also show the
available branches.
Reference: http://superuser.com/a/437508/119764
Some functions were specific to OS X, but were defined in the `base` plugin. I have moved them to the `osx` plugin:
* pman
* pcurl
* pri
As for `pcurl`, the `osx` plugin already had an existing `prevcurl` function, which was doing the same thing. I've aliased `pcurl` to simply call `prevcurl` to avoid breaking existing installations.
As far as I know the `open -fa $PREVIEW` thing only works on OS X, which means that these functions have only worked on OS X anyway.
A set of functions to simplify listing OS X Time Machine backups, and
deleting old ones. Pulled from various script solutions found on Stack
Overflow, adapted to the Bash-it framework.
The functions allow to show which backups can be found on the connected
Time Machine volume. The 'delete' function allows to safely remove all
backups except for the latest one - this can be used to free up space on
the Time Machine volume. The 'delete' function uses functionality of the
OS to safely remove the old backups, no information is lost.
The 'delete' function will only ask for the password once, then keep the credentials.
Source: http://stackoverflow.com/a/30547074/1228454
When pygmentize is not installed, the functions less/cat are not
defined, the native commands will be used instead. Also removed the
error message that was shown when the command was not found.
Using `command -v` instead of `which` to check for the existence of the
executable - this works better as it does not print an error message if
the executable is not found.
This will allow to open new terminal tabs in the same directory as the
current terminal. Uses the fact that plugins are loaded after the
selected theme. Themes often manipulate the $PROMPT_COMMAND variable.
Implementation inspired by the pathmunge function.
The previous version was printing an error when the battery percentage
was in the single digits, e.g. "7.04%". The code cuts returns the first
two digits, which in the case of "7.04%" are "7.". Any code that tries
to use that, e.g. the powerline-multiline theme will fail with an error.
This change corrects that by zero padding single digits, i.e. "07.04%"
instead of "7.04%".
These settings shouldn't be in the profile template, as they only make sense when used with nginx.
If you're using nginx, you can enable the nginx plugin.
The vagrant.plugin.bash file only defined a completion function, nothing
more. The vagrant.completion.bash file has a more recent completion
function for vagrant. We don't need both, and the completion in the
plugin file was in the wrong location in the first place.
If you had multiple terminal windows open, there was a chance that the command was sent to another window (the one with index 1). Using index 0 will execute it in the currently visible window.
working in concert with one another.
Features added:
- Added a pyenv-virtualenv plugin which creates virtual environments
using the current pyenv python version
- `cd` into a directory that has a virtual environment already created
and autoenv will automatically activate that environment
- Current virtual environment is displayed in command prompt