-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1979 from gaelicWizard/preexec-histcontrol
preexec: work around upstream mangling of `$HISTCONTROL`
- Loading branch information
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
# shellcheck shell=bash | ||
# shellcheck disable=1090 | ||
source "${BASH_IT}"/vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh | ||
# shellcheck disable=SC2034 | ||
# | ||
# Load the `bash-preexec.sh` library, and define helper functions | ||
|
||
## Prepare, load, fix, and install `bash-preexec.sh` | ||
|
||
# Disable immediate `$PROMPT_COMMAND` modification | ||
__bp_delay_install="delayed" | ||
|
||
# shellcheck source-path=SCRIPTDIR/../github.com/rcaloras/bash-preexec | ||
source "${BASH_IT?}/vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh" | ||
|
||
# Block damanaging user's `$HISTCONTROL` | ||
function __bp_adjust_histcontrol() { :; } | ||
|
||
# Don't fail on readonly variables | ||
function __bp_require_not_readonly() { :; } | ||
|
||
# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040 | ||
__bp_enable_subshells= # blank | ||
set +T | ||
|
||
# Modify `$PROMPT_COMMAND` now | ||
__bp_install_after_session_init |