Skip to content

Commit

Permalink
Remove ignorespace from $HISTCONTROL
Browse files Browse the repository at this point in the history
- Brought up in issue #6
  • Loading branch information
rcaloras committed Jun 18, 2015
1 parent a3327c3 commit 3458480
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bash-preexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ if [[ "$__bp_imported" == "defined" ]]; then
fi
__bp_imported="defined"


# Remove ignorespace from HISTCONTROL so we can accurately
# invoke preexec with a command from our history even if it
# starts with a space.
export HISTCONTROL="${HISTCONTROL//ignorespace}"


# This variable describes whether we are currently in "interactive mode";
# i.e. whether this shell has just executed a prompt and is waiting for user
# input. It documents whether the current command invoked by the trace hook is
Expand Down
7 changes: 7 additions & 0 deletions test/bash-preexec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,10 @@ test_preexec_echo() {
[[ $status == 1 ]]

}

@test "HISTCONTROL should remove ignorespace" {

HISTCONTROL="ignorespace:ignoredups:*"
HISTCONTROL="${HISTCONTROL//ignorespace}"
[[ "$HISTCONTROL" == ":ignoredups:*" ]]
}

0 comments on commit 3458480

Please sign in to comment.