xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
Commit 1f2ee46e39225e2505810d7f958ba8d17628a5f0

Removing history flushing (could not work as running in child shell and is shell built-in.
Author: Martin Dvorak
Author date (UTC): 2013-12-15 13:13
Committer name: Martin Dvorak
Committer date (UTC): 2013-12-15 13:13
Parent(s): fa9b42ded386cd3e288df2c3ec2639524b1d6768
Signing key:
Tree: cd24014cc6f75c3afd78ee3827726f1b828d8222
File Lines added Lines deleted
README.md 10 4
src/hstr_history.c 0 7
File README.md changed (mode: 100644) (index 52722fc..0390b32)
... ... https://github.com/dvorka/hstr/releases
17 17
18 18 INSTALLATION INSTALLATION
19 19 ------------ ------------
20 * bind `hh` to a key and/or add it to $PATH
21 * bind `hh` to a BASH key by adding a line to your `.bashrc`, e.g. Ctrl-R:
20 * add
21
22 `shopt -s histappend`
23 `export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"`
24
25 at the end of `.bashrc` in order to ensure that BASH history of commands
26 will be kept in sync with filesystem.
27 * bind `hh` to a BASH key by adding a line to `.bashrc`, e.g. Ctrl-R:
22 28
23 29 `bind '"\C-r": "\C-k\C-uhh\C-j"'` `bind '"\C-r": "\C-k\C-uhh\C-j"'`
24 30
 
... ... INSTALLATION
32 38
33 39 To determine the character sequence emitted by a pressed key in terminal, To determine the character sequence emitted by a pressed key in terminal,
34 40 type CTRL-v and then press the key. For example, F12 gives `^[[24~`. type CTRL-v and then press the key. For example, F12 gives `^[[24~`.
35 Replace the `^[` with `\e`. To clear the line first, add `\C-k \C-u` in front of
36 the actual command. Check your current bindings using:
41 Replace the `^[` with `\e`. To clear the line first, add `\C-k \C-u` in
42 front of the actual command. Check your current bindings using:
37 43
38 44 `bind -S` `bind -S`
39 45
File src/hstr_history.c changed (mode: 100644) (index cde4a97..1d57aa3)
... ... void free_prioritized_history() {
115 115 // TODO free(prioritizedHistory); // TODO free(prioritizedHistory);
116 116 } }
117 117
118 void flush_history() {
119 const char *filename = "history";
120 char *const args[1] = {"-a"};
121 execvp(filename, args);
122 }
123
124 118 HistoryItems *get_history_items() { HistoryItems *get_history_items() {
125 119 history=(HistoryItems *)malloc(sizeof(HistoryItems)); history=(HistoryItems *)malloc(sizeof(HistoryItems));
126 120
127 flush_history();
128 121 using_history(); using_history();
129 122
130 123 char *historyFile = getenv(ENV_VAR_HISTFILE); char *historyFile = getenv(ENV_VAR_HISTFILE);
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master