mirror of
https://github.com/dvorka/hstr.git
synced 2024-12-27 09:53:11 +08:00
This commit is contained in:
parent
0bfb65b6ad
commit
be13501e30
1 changed files with 10 additions and 0 deletions
10
src/hstr.c
10
src/hstr.c
|
@ -182,6 +182,16 @@ static const char *INSTALL_BASH_STRING=
|
|||
"\nexport HISTCONTROL=ignorespace # leading space hides commands from history"
|
||||
"\nexport HISTFILESIZE=10000 # increase history file size (default is 500)"
|
||||
"\nexport HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)"
|
||||
// PROMPT_COMMAND considerations:
|
||||
// history -a ... append NEW entries from memory to .bash_history (i.e. flush to file where HSTR reads commands)
|
||||
// history -n ... append NEW entries from .bash_history to memory i.e. NOT entire history reload
|
||||
// history -c ... CLEAR in memory history (keeps .bash_history content)
|
||||
// history -r ... append ALL entries from .bash_history to memory (useful to sync DIFFERENT Bash sessions)
|
||||
// Conclusion:
|
||||
// -a -n ... Fastest and almost-consistent option i.e. there is efficiency/integrity trade-off
|
||||
// It works correctly if memory entries are not deleted by HSTR. It doesn't synchronize history
|
||||
// across different Bash sessions.
|
||||
// -c -r ... Forces entire .bash_history to be reloaded (handles history deletes, synchronizes different Bash sessions)
|
||||
"\nexport PROMPT_COMMAND=\"history -a; history -n; ${PROMPT_COMMAND}\" # mem/file sync"
|
||||
"\n# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)"
|
||||
// IMPROVE hh (win10) vs. hstr (cygwin) binary on various platforms must be resolved
|
||||
|
|
Loading…
Reference in a new issue