File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ if [[ "$__bp_imported" == "defined" ]]; then
4040fi
4141__bp_imported=" defined"
4242
43+
44+ # Remove ignorespace from HISTCONTROL so we can accurately
45+ # invoke preexec with a command from our history even if it
46+ # starts with a space.
47+ export HISTCONTROL=" ${HISTCONTROL// ignorespace} "
48+
49+
4350# This variable describes whether we are currently in "interactive mode";
4451# i.e. whether this shell has just executed a prompt and is waiting for user
4552# input. It documents whether the current command invoked by the trace hook is
Original file line number Diff line number Diff line change @@ -113,3 +113,10 @@ test_preexec_echo() {
113113 [[ $status == 1 ]]
114114
115115}
116+
117+ @test " HISTCONTROL should remove ignorespace" {
118+
119+ HISTCONTROL=" ignorespace:ignoredups:*"
120+ HISTCONTROL=" ${HISTCONTROL// ignorespace} "
121+ [[ " $HISTCONTROL " == " :ignoredups:*" ]]
122+ }
You can’t perform that action at this time.
0 commit comments