My apologies to future `git blame` hunters ♥
Use the "short" host name by default (`\h`), not the fully qualified domain name (`\H`)...
lib/theme: don't redefine battery_char()
Combine the two definitions for `battery_char()` so the second one doesn't just overwrite the first one. Do one or the other, not both.
Don't evaluate if `battery_percentage()` is available at load time, evaluate it at run time.
Don't run `date` for `$THEME_TIME_FORMAT`, use `\D{fmt}`.
Two new functions `_bash-it-history-auto-save()` and `_bash-it-history-auto-load()`, which append new history to disk and load new history from disk, respectively.
See bash-it/bash-it#1595 for discussion.
Define the helper functions for `bash-preexec.sh` immediately after importing it, rather than in `lib/theme`.
- `__check_precmd_conflict()` and `save_append_prompt_command()` are generally useful and not theme-specific.
- Add matching `__check_preexec_conflict()` and `safe_append_preexec()`.
Create an array `_bash_it_library_finalize_hook` and loop at the end of the main `bash_it.sh` to run each element in the array.
The purpose here is to run some command after everything else has been loaded. For example, the appearance lib checks for executables for SCM commands, but `$PATH` may be altered after appearance has loaded and therefore some available commands may never be discovered. Therefore, create `_bash_it_appearance_scm_init()` and add it to the hook. It will re-check at end of `bash_it.sh` just before prompt is first displayed.
* CI: disable Ubuntu 16.04 as it's EOL
https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/
* main: lint false positive
* install: lint
* plugins/cmd-returned-notify: don't `export`
* plugins/xterm: lint
* plugins/git: lint
* plugins/goenv: lint
* plugins/alias-completion: lint false positives
* plugins/alias-completion: fix SC2155, SC2154
Declare `locals` at the top of the function
* completion: lint completions using `bash_completion` functions
Match the style of the existing code
* completion/knife: lint false positives
* completion/knife: lint
* completion/sdkman: lint
* completion/composer: lint
* Move `.shellcheckrc` under `themes/`
* lib/theme: fix SC2155, SC2154, SC2034
* lib/colors: don't warn on unused variables
We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only).
Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now.
* themes/agnoster: lint
* themes: disable SC2154 for colors
Each one of these themes will need it’s own fix for SC2154, possibly upstream.
Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.
* themes: disable SC2154, fix SC2155
Each one of these themes will need it’s own fix for SC2154, possibly upstream.
Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.
* Delete `.shellcheckrc`
* remove executable bit
Wrap init code in a function and call the function immediately. Several plugins do this, and it allows us to more easily implement a hooks-based system in the future.
Alsö, avoid external binary `which`. Use built-in `type -P` instead. Uppercase `-P` forces a path search to avoid hashed matches and functions/aliases and whatnot.
hexdump by default will replace any repeated groups with an asterisk and
a newline, which breaks prompts. This can be disabled with the `-v`
flag. For example:
```
printf 'aac' | hexdump -e '1/1 "%02x"'
61*
63
printf 'abc' | hexdump -e '1/1 "%02x"'
616263
printf 'aac' | hexdump -ve '1/1 "%02x"'
616163
```
When spawning a new bash session when entering a virtual environment
the VIRTUAL_ENV is overwritten by this line.
However not having this line does not affect the bin/activate script.
Stop as soon as "svn status" shows a change, not needed to walk through
all the changes in the whole repository. For my large repository this is
about twice as fast.
Extract just the information we need from "svn info"
When current-context does not exist or is unset in $KUBECONFIG, kubectl
is throwing a message to stderr "error: current-context is not set".
Ignore it.