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 bd72ff87b2bd237f367b7c443891ce2d429ba0c3

Fixing compile time warnings and errors @ Ubuntu.
Author: Martin Dvorak
Author date (UTC): 2014-04-13 08:44
Committer name: Martin Dvorak
Committer date (UTC): 2014-04-13 08:44
Parent(s): e29fa381905df00442096a29a72dbb2c333c3078
Signing key:
Tree: 4f1f5b9367f35bbc495c29bfa7a34d6328cfc71b
File Lines added Lines deleted
dist/ubuntu-env.sh 4 4
src/Makefile.am 4 3
src/hstr.c 8 5
src/include/hstr_history.h 1 0
File dist/ubuntu-env.sh changed (mode: 100755) (index 5e6fdd0..837c68a)
1 1 #!/bin/bash #!/bin/bash
2 2
3 export HHVERSION="1.8.11"
3 export HHVERSION="1.9.1"
4 4 export HHFULLVERSION=${HHVERSION}-0ubuntu1 export HHFULLVERSION=${HHVERSION}-0ubuntu1
5 5 export HH=hh_${HHVERSION} export HH=hh_${HHVERSION}
6 6 export HHRELEASE=hh_${HHFULLVERSION} export HHRELEASE=hh_${HHFULLVERSION}
 
... ... export NOW=`date +%Y-%m-%d--%H-%M-%S`
9 9 export HHBUILD=hstr-${NOW} export HHBUILD=hstr-${NOW}
10 10
11 11 ## https://wiki.ubuntu.com/Releases ## https://wiki.ubuntu.com/Releases
12 #export UBUNTUVERSION=precise
12 export UBUNTUVERSION=precise
13 13 #export UBUNTUVERSION=quantal #export UBUNTUVERSION=quantal
14 14 #export UBUNTUVERSION=saucy #export UBUNTUVERSION=saucy
15 export UBUNTUVERSION=trusty
15 #export UBUNTUVERSION=trusty
16 16
17 export HHBZRMSG="Fixed escape sequence rendering from the history."
17 export HHBZRMSG="Favorites - favorite commands can be bookmarked and shown in a new view!"
18 18
19 19 # - user email must be the same as in gpg i.e. (Dvorka) must present # - user email must be the same as in gpg i.e. (Dvorka) must present
20 20 # - hh_ must be with underscore (dh_make enforced) # - hh_ must be with underscore (dh_make enforced)
File src/Makefile.am changed (mode: 100644) (index e5ea109..0476e56)
... ... AM_LDFLAGS =
5 5 # bin_ installs to bin; hh_ is the binary name # bin_ installs to bin; hh_ is the binary name
6 6 bin_PROGRAMS = hh bin_PROGRAMS = hh
7 7
8 hh_SOURCES = \
8 hh_SOURCES = \
9 9 hashset.c include/hashset.h \ hashset.c include/hashset.h \
10 hstr_curses.c include/hstr_curses.h \
11 hstr_history.c include/hstr_history.h \
10 hstr_curses.c include/hstr_curses.h \
11 hstr_history.c include/hstr_history.h \
12 12 hstr_utils.c include/hstr_utils.h \ hstr_utils.c include/hstr_utils.h \
13 hstr_favorites.c include/hstr_favorites.h \
13 14 radixsort.c include/radixsort.h \ radixsort.c include/radixsort.h \
14 15 hstr.c hstr.c
File src/hstr.c changed (mode: 100644) (index 5b79e76..e8dccca)
22 22
23 23 #include "include/hashset.h" #include "include/hashset.h"
24 24 #include "include/hstr_curses.h" #include "include/hstr_curses.h"
25 #include "include/hstr_favorites.h"
25 26 #include "include/hstr_history.h" #include "include/hstr_history.h"
26 27 #include "include/hstr_utils.h" #include "include/hstr_utils.h"
27 28
 
... ... unsigned make_selection(char *prefix, HistoryItems *history, int maxSelectionCou
291 292 unsigned count; unsigned count;
292 293
293 294 switch(historyView) { switch(historyView) {
294 case HH_VIEW_RANKING:
295 source=history->items;
296 count=history->count;
297 break;
298 295 case HH_VIEW_HISTORY: case HH_VIEW_HISTORY:
299 296 source=history->raw; source=history->raw;
300 297 count=history->rawCount; count=history->rawCount;
 
... ... unsigned make_selection(char *prefix, HistoryItems *history, int maxSelectionCou
303 300 source=history->favorites->items; source=history->favorites->items;
304 301 count=history->favorites->count; count=history->favorites->count;
305 302 break; break;
303 case HH_VIEW_RANKING:
304 default:
305 source=history->items;
306 count=history->count;
307 break;
306 308 } }
307 309
308 310 for(i=0; i<count && selectionCount<maxSelectionCount; i++) { for(i=0; i<count && selectionCount<maxSelectionCount; i++) {
 
... ... void loop_to_select(HistoryItems *history)
547 549 selectionCursorPosition=0; selectionCursorPosition=0;
548 550 break; break;
549 551 case K_CTRL_SLASH: case K_CTRL_SLASH:
550 historyView=(++historyView)%3;
552 historyView++;
553 historyView=historyView%3;
551 554 result=print_selection(maxHistoryItems, pattern, history); result=print_selection(maxHistoryItems, pattern, history);
552 555 print_history_label(history); print_history_label(history);
553 556 selectionCursorPosition=0; selectionCursorPosition=0;
File src/include/hstr_history.h changed (mode: 100644) (index b0ce1f4..23e3251)
17 17 #include <readline/history.h> #include <readline/history.h>
18 18 #include <unistd.h> #include <unistd.h>
19 19 #include <stdbool.h> #include <stdbool.h>
20
20 21 #include "hstr_favorites.h" #include "hstr_favorites.h"
21 22 #include "hstr_utils.h" #include "hstr_utils.h"
22 23 #include "hashset.h" #include "hashset.h"
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