File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 16
16
# since 'fasd' is messing with the $PROMPT_COMMAND
17
17
18
18
19
+ case $HISTCONTROL in
20
+ * ' auto' * )
21
+ : # Do nothing, already configured.
22
+ ;;
23
+ * )
24
+ # Append new history lines to history file
25
+ HISTCONTROL=" ${HISTCONTROL:- }${HISTCONTROL: +: } autosave"
26
+ ;;
27
+ esac
28
+ safe_append_preexec ' _bash-it-history-auto-load'
29
+ safe_append_prompt_command ' _bash-it-history-auto-save'
30
+
19
31
PROMPT_END_CLEAN=" ${green} →${reset_color} "
20
32
PROMPT_END_DIRTY=" ${red} →${reset_color} "
21
33
@@ -28,8 +40,6 @@ prompt_setter() {
28
40
if [[ $exit_status -eq 0 ]]; then PROMPT_END=$PROMPT_END_CLEAN
29
41
else PROMPT_END=$PROMPT_END_DIRTY
30
42
fi
31
- # Save history
32
- _save-and-reload-history 1
33
43
PS1=" ($( clock_prompt) ) $( scm_char) [${blue} \u${reset_color} @${green} \H${reset_color} ] ${yellow} \w${reset_color} $( scm_prompt_info) ${reset_color} \n$( prompt_end) "
34
44
PS2=' > '
35
45
PS4=' + '
Original file line number Diff line number Diff line change @@ -95,13 +95,23 @@ prompt_setter() {
95
95
if [[ $exit_status -eq 0 ]]; then PROMPT_END=$PROMPT_END_CLEAN
96
96
else PROMPT_END=$PROMPT_END_DIRTY
97
97
fi
98
- # Save history
99
- _save-and-reload-history 1
100
98
PS1=" ($( clock_prompt) ${reset_color} ) $( scm_char) [${USERNAME_COLOR} \u${reset_color} @${HOSTNAME_COLOR} \H${reset_color} ] ${PATH_COLOR} \w${reset_color} $( scm_prompt_info) ${reset_color} \n$( prompt_end) "
101
99
PS2=' > '
102
100
PS4=' + '
103
101
}
104
102
103
+ case $HISTCONTROL in
104
+ * ' auto' * )
105
+ : # Do nothing, already configured.
106
+ ;;
107
+ * )
108
+ # Append new history lines to history file
109
+ HISTCONTROL=" ${HISTCONTROL:- }${HISTCONTROL: +: } autosave"
110
+ ;;
111
+ esac
112
+ safe_append_preexec ' _bash-it-history-auto-load'
113
+ safe_append_prompt_command ' _bash-it-history-auto-save'
114
+
105
115
safe_append_prompt_command prompt_setter
106
116
107
117
SCM_THEME_PROMPT_DIRTY=" ${bold_red} ✗${normal} "
You can’t perform that action at this time.
0 commit comments