Codebase list hstr / 7a73d0c
New upstream version 2.5+ds Daniel Echeverri 2 years ago
45 changed file(s) with 232 addition(s) and 92 deletion(s). Raw diff Collapse all Expand all
0 2021-12-13 Martin Dvorak <martin.dvorak@mindforger.com>
1
2 * Released v2.5.0 - minor fix release to fix Arch build.
3
4 2021-12-03 Martin Dvorak <martin.dvorak@mindforger.com>
5
6 * Released v2.4.0 - ability to insert custom command to terminal prompt,
7 minor fixes.
8
09 2020-11-19 Martin Dvorak <martin.dvorak@mindforger.com>
110
211 * Released v2.3.0 - zsh timestamp extended history parsing and SEGFAULT fixes.
88 * [RHEL](#fedorarhelcentosscientific)
99 * [Debian](#debianmint)
1010 * [Mint](#debianmint)
11 * [Alpine Linux](#alpine-linux)
1112 * [Arch Linux](#archmanjaro-linux)
1213 * [Milis Linux](#milis-linux)
1314 * [Manjaro Linux](#archmanjaro-linux)
3132 Tarball:
3233
3334 * [build and install tarball](#build-and-install-tarball)
35
36 Upgrade:
37
38 * [HSTR 1.x to 2.x](#upgrade)
3439 # Install
35 Install HSTR using a package.
36
40 Install HSTR using a [package](https://pkgs.org/search/?q=hstr) or repository.
3741 ## Ubuntu
38 Install HSTR on Ubuntu using one-liner:
42 HSTR is [included in Ubuntu 21.10](https://packages.ubuntu.com/impish/utils/hstr) and [newer](https://wiki.ubuntu.com/Releases) releases:
43
44 ```
45 sudo apt install hstr
46 ```
47
48 ---
49
50 Install HSTR on **Ubuntu 21.04 and older** using one-liner:
3951
4052 ```bash
4153 sudo add-apt-repository ppa:ultradvorka/ppa && sudo apt-get update && sudo apt-get install hstr && hstr --show-configuration >> ~/.bashrc && . ~/.bashrc
5264 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
5365
5466 ## Debian/Mint
55 Install HSTR from PPA. Add [my PPA](https://www.mindforger.com/debian),
67 HSTR is [included in Debian 11](https://packages.debian.org/bullseye/hstr) and [newer](https://www.debian.org/releases/) releases:
68
69 ```
70 sudo apt install hstr
71 ```
72
73 ---
74
75 Install HSTR on **Debian 10 and older** from my PPA. Add [PPA](https://www.mindforger.com/debian),
5676 trust [GPG key](https://www.mindforger.com/gpgpubkey.txt) and install HSTR:
5777
5878 ```bash
7797 section of the project:
7898
7999 ```bash
80 wget -O hstr.deb https://github.com/dvorka/hstr/releases/download/2.3/hstr_<major>.<minor>.<revision>-1_amd64.deb
100 wget -O hstr.deb https://github.com/dvorka/hstr/releases/download/<major>.<minor>/hstr_<major>.<minor>.<revision>-1_amd64.deb
81101
82102 # dependencies:
83103 apt-get install libncursesw5 libtinfo5
87107
88108
89109 ## Fedora/RHEL/CentOS/Scientific
90 Install HSTR on Fedora, RHEL, CentOS or Scientific Linux:
110 Install HSTR on [Fedora](https://src.fedoraproject.org/rpms/hstr), RHEL, CentOS or Scientific Linux:
91111
92112 ```bash
93113 sudo dnf install hstr
103123 ---
104124
105125 If you want to make sure you have the latest version, then download `.rpm` archive from
106 [GitHub releases](https://github.com/dvorka/hstr/releases) and install it:
126 [GitHub releases](https://github.com/dvorka/hstr/releases) or [pkgs.org](https://pkgs.org/search/?q=hstr) and install it:
107127
108128 ```bash
109129 sudo dnf install ./hstr-<major>.<minor>.<revision>-2.x86_64.rpm
110130 ```
111131
112132 ## openSUSE
113 To install HSTR on openSUSE, please check https://software.opensuse.org/package/hstr first. You can install HSTR as shown below (just choose repository you like):
133 To install HSTR on openSUSE, please check [software.opensuse.org](https://software.opensuse.org/package/hstr) or [pkgs.org](https://pkgs.org/search/?q=hstr). You can install HSTR as follows:
114134
115135 ```bash
116136 zypper addrepo https://download.opensuse.org/repositories/home:lemmy04/openSUSE_Leap_15.1/home:lemmy04.repo
119139 ```
120140
121141 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
122
123142 ## Gentoo
124143 To install HSTR on Gentoo run (HSTR has been added to [Portage](https://bugs.gentoo.org/show_bug.cgi?id=527122)):
125144
129148
130149 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
131150
151 ## Alpine Linux
152
153 To install HSTR on Alpine Linux run the following command as root:
154
155 ```bash
156 apk add hstr
157 ```
158
159 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
160
161 ## ALT Linux
162 To install HSTR on ALT Linux, please check [pkgs.org](https://pkgs.org/search/?q=hstr). You can install HSTR as follows:
163
164 ```bash
165 rpm [p10] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/p10 x86_64 autoimports
166 rpm [p10] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/p10 noarch autoimports
167
168 sudo apt-get update
169
170 sudo apt-get install hstr
171 ```
172
173 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
132174 ## Arch/Manjaro Linux
133 To install HSTR on Arch or Manjaro Linux download the latest distribution from [GitHub releases](https://github.com/dvorka/hstr/releases).
175 To install HSTR on Arch or Manjaro Linux download the latest distribution either from [pkgs.org](https://pkgs.org/search/?q=hstr) or [GitHub releases](https://github.com/dvorka/hstr/releases).
134176
135177 Use [PKGBUILD](https://wiki.archlinux.org/index.php/PKGBUILD) in the root of the distribution to build package using `makepkg`.
136178
137179 To install HSTR from the [Arch User Repository (AUR)](https://aur.archlinux.org/packages/hstr-git/) run `yaourt -S hstr-git` in command line.
138180
181 ## FreeBSD
182 To install HSTR on FreeBSD, please check [pkgs.org](https://pkgs.org/search/?q=hstr). You can install HSTR as follows:
183
184 ```bash
185 pkg install hstr
186 ```
187
188 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
189 ## Slackware
190 To install HSTR on Slackware, please check [pkgs.org](https://pkgs.org/search/?q=hstr). You can install HSTR as follows:
191
192 ```bash
193 upgradepkg --install-new hstr-<major>.<minor>-x86_64-1cf.txz
194 ```
195
196 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
197 ## Void Linux
198 To install HSTR on Void Linux, please check [pkgs.org](https://pkgs.org/search/?q=hstr). You can install HSTR as follows:
199
200 ```bash
201 xbps-install -Su hstr
202 ```
203
204 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
139205 ## Milis Linux
140206 To install HSTR on Milis Linux run the following commands as root:
141207
265331 Install dependencies:
266332
267333 ```bash
268 sudo apt install autotools gcc make libncursesw5-dev libreadline-dev
334 sudo apt install autotools gcc make pkgconf libncursesw5-dev libreadline-dev
269335 ```
270336
271337 Create build files using:
422488 ```
423489
424490 [Configure](CONFIGURATION.md) HSTR and check its [man page](README.md#documentation).
491 # Upgrade
492 Upgrade HSTR using a [package](https://pkgs.org/search/?q=hstr) or repository. If you are `HSTR 1.x` user, please read about [HSTR 2.x changes](https://github.com/dvorka/hstr/releases/tag/2.0).
493
494
33 # Contributor: Busindre <busilezas at busindre.com>
44
55 pkgname=hstr
6 pkgver=2.3
6 pkgver=2.5
77 pkgrel=1
88 pkgdesc="A command line utility that brings improved BASH command completion from the history. It aims to make completion easier and more efficient than Ctrl-r."
99 arch=('any')
3030 Install:
3131
3232 * [Ubuntu](INSTALLATION.md#ubuntu)
33 * [Fedora](INSTALLATION.md#fedorarhelcentosscientific)
34 * [Gentoo](INSTALLATION.md#gentoo)
35 * [CentOS](INSTALLATION.md#fedorarhelcentosscientific)
36 * [openSUSE](INSTALLATION.md#opensuse)
37 * [RHEL](INSTALLATION.md#fedorarhelcentosscientific)
3833 * [Debian](INSTALLATION.md#debianmint)
3934 * [Mint](INSTALLATION.md#debianmint)
40 * [Arch Linux](INSTALLATION.md#archmanjaro-linux)
35 * [Fedora](INSTALLATION.md#fedorarhelcentosscientific)
36 * [CentOS](INSTALLATION.md#fedorarhelcentosscientific)
37 * [RHEL](INSTALLATION.md#fedorarhelcentosscientific)
38 * [Scientific Linux](INSTALLATION.md#fedorarhelcentosscientific)
39 * [openSUSE](INSTALLATION.md#opensuse)
40 * [Gentoo](INSTALLATION.md#gentoo)
41 * [Alpine Linux](INSTALLATION.md#alpine-linux)
42 * [Arch](INSTALLATION.md#archmanjaro-linux)
4143 * [Manjaro Linux](INSTALLATION.md#archmanjaro-linux)
42 * [Scientific Linux](INSTALLATION.md#fedorarhelcentosscientific)
44 * [FreeBSD](INSTALLATION.md#freebsd)
45 * [Slackware Linux](INSTALLATION.md#slackware)
46 * [Void Linux](INSTALLATION.md#void-linux)
47 * [Milis Linux](INSTALLATION.md#milis-linux)
4348 * [Haiku OS](INSTALLATION.md#haiku-os)
4449 * [macOS](INSTALLATION.md#macos)
4550 * [nix package manager](INSTALLATION.md#nix-package-manager)
6065
6166 * [build and install tarball](INSTALLATION.md#build-and-install-tarball)
6267
68 Check also [packages](https://pkgs.org/search/?q=hstr) for Linux and Unix.
6369
6470 ## Configuration
6571 Configure HSTR just by running:
7480 For detailed HSTR configuration documentation please refer to [Configuration](CONFIGURATION.md).
7581
7682
83 ## In the News
84 Read about HSTR in [LinuxMagazine](http://www.linux-magazine.com/Issues/2014/164/Bash-History-on-Steroids), [UbuntuGeek](http://www.ubuntugeek.com/tag/hstr-bash-history), [DebianAdmin](http://www.debianadmin.com/hstr-easily-view-navigate-search-and-use-your-command-history-with-shell-history.html), [Tuxdiary](http://tuxdiary.com/2015/02/17/hstr/), [Softpedia](http://linux.softpedia.com/get/Terminals/BASH-Command-History-Completion-103155.shtml) and [OSTechNix](https://www.ostechnix.com/hstr-easily-view-navigate-search-manage-commandline-history/).
85
86
7787 ## Documentation
7888 Check man page:
7989
8191 man hstr
8292 ```
8393
84 ## In the News
85 Read about HSTR in [LinuxMagazine](http://www.linux-magazine.com/Issues/2014/164/Bash-History-on-Steroids), [UbuntuGeek](http://www.ubuntugeek.com/tag/hstr-bash-history), [DebianAdmin](http://www.debianadmin.com/hstr-easily-view-navigate-search-and-use-your-command-history-with-shell-history.html), [Tuxdiary](http://tuxdiary.com/2015/02/17/hstr/), [Softpedia](http://linux.softpedia.com/get/Terminals/BASH-Command-History-Completion-103155.shtml) and [OSTechNix](https://www.ostechnix.com/hstr-easily-view-navigate-search-manage-commandline-history/).
86
87
88 ## Upgrade
89 If you are HSTR 1.x user, please read about [HSTR 2.x changes](https://github.com/dvorka/hstr/releases/tag/2.0).
90
91
94 User videos: [Zack](https://www.youtube.com/watch?v=Qd75pIeQkH8), [Dvorka](https://www.youtube.com/watch?v=sPF29NyXe2U) and [Yu-Jie Lin](https://www.youtube.com/watch?v=Qx5n_5B5xUw).
9295 ## Bugs
9396 https://github.com/dvorka/hstr/issues
0 # Security Policy
1
2 ## Supported Versions
3
4 The following HSTR versions are currently being supported with security updates.
5
6 | Version | Supported |
7 | ------- | ------------------ |
8 | 2.5.0 | :white_check_mark: |
9 | 2.4.0 | :white_check_mark: |
10 | <= 2.3.0 | :x: |
11
12 ## Reporting a Vulnerability
13
14 Please report HSTR vulnerabilities to
15 [martin.dvorak@mindforger.com](martin.dvorak@mindforger.com)
16
17 All reported vulnerabilities will be examined, reproduced and
18 expected fix release and release date will be shared with
19 the reporter.
00 # configure.ac Autoconf configuration file
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
1919
2020 AC_PREREQ([2.69])
2121
22 AC_INIT(hstr, 2.3.0, martin.dvorak@mindforger.com)
22 AC_INIT(hstr, 2.5.0, martin.dvorak@mindforger.com)
2323 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
2424
2525 # Check src dir existence.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 # hstr.pro Qt project file for HSTR shell history compleation utility
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
2222 .TP
2323 \fB-k --kill-last-command\fR
2424 Delete the last command from history and exit
25 .TP
26 \fB-i --insert-in-terminal=[command]\fR
27 Insert custom command to terminal prompt and exit
2528 .TP
2629 \fB-f --favorites\fR
2730 Show favorites view immediately
220223 .TP
221224 \fBhstr --show-blacklist\fR
222225 Show blacklist configured for history processing.
226 .TP
227 \fBhstr --insert-in-terminal="git add . && git diff --cached"\fR
228 Insert command in terminal prompt and exit.
223229 .SH AUTHOR
224230 Written by Martin Dvorak <martin.dvorak@mindforger.com>
225231 .SH BUGS
11 <!--
22 pad.xml PAD file for HSTR
33
4 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
4 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
55
66 Licensed under the Apache License, Version 2.0 (the "License");
77 you may not use this file except in compliance with the License.
5050 </Company_Info>
5151 <Program_Info>
5252 <Program_Name>HSTR</Program_Name>
53 <Program_Version>2.3.0</Program_Version>
54 <Program_Release_Month>01</Program_Release_Month>
55 <Program_Release_Day>01</Program_Release_Day>
56 <Program_Release_Year>2020</Program_Release_Year>
53 <Program_Version>2.5.0</Program_Version>
54 <Program_Release_Month>12</Program_Release_Month>
55 <Program_Release_Day>13</Program_Release_Day>
56 <Program_Release_Year>2021</Program_Release_Year>
5757 <Program_Cost_Dollars />
5858 <Program_Cost_Other_Code>USD</Program_Cost_Other_Code>
5959 <Program_Cost_Other />
00 # snapcraft.yaml snap builder configuration
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 /*
11 hashset.c hash set implementation
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr.c HSTR shell history completion utility
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
136136
137137 // major.minor.revision
138138 static const char* VERSION_STRING=
139 "hstr version \"2.3.0\" (2020-11-19T07:41:00)"
139 "hstr version \"2.5.0\" (2021-12-13T22:00:00)"
140140 "\n";
141141
142142 static const char* HSTR_VIEW_LABELS[]={
262262 "\n --show-configuration -s ... show configuration to be added to ~/.bashrc"
263263 "\n --show-zsh-configuration -z ... show zsh configuration to be added to ~/.zshrc"
264264 "\n --show-blacklist -b ... show commands to skip on history indexation"
265 "\n --insert-in-terminal=[c] -i ... insert command c in terminal prompt and exit"
265266 "\n --version -V ... show version details"
266267 "\n --help -h ... help"
267268 "\n"
278279 #define GETOPT_OPTIONAL_ARGUMENT 2
279280
280281 static const struct option long_options[] = {
281 {"favorites", GETOPT_NO_ARGUMENT, NULL, 'f'},
282 {"kill-last-command", GETOPT_NO_ARGUMENT, NULL, 'k'},
283 {"version", GETOPT_NO_ARGUMENT, NULL, 'V'},
284 {"help", GETOPT_NO_ARGUMENT, NULL, 'h'},
285 {"non-interactive", GETOPT_NO_ARGUMENT, NULL, 'n'},
286 {"show-configuration", GETOPT_NO_ARGUMENT, NULL, 's'},
287 {"show-zsh-configuration", GETOPT_NO_ARGUMENT, NULL, 'z'},
288 {"show-blacklist", GETOPT_NO_ARGUMENT, NULL, 'b'},
289 {0, 0, NULL, 0 }
282 {"favorites", GETOPT_NO_ARGUMENT, NULL, 'f'},
283 {"kill-last-command", GETOPT_NO_ARGUMENT, NULL, 'k'},
284 {"version", GETOPT_NO_ARGUMENT, NULL, 'V'},
285 {"help", GETOPT_NO_ARGUMENT, NULL, 'h'},
286 {"non-interactive", GETOPT_NO_ARGUMENT, NULL, 'n'},
287 {"show-configuration", GETOPT_NO_ARGUMENT, NULL, 's'},
288 {"show-zsh-configuration", GETOPT_NO_ARGUMENT, NULL, 'z'},
289 {"show-blacklist", GETOPT_NO_ARGUMENT, NULL, 'b'},
290 {"insert-in-terminal", GETOPT_REQUIRED_ARGUMENT, NULL, 'i'},
291 {0, 0, NULL, 0 }
290292 };
291293
292294 typedef struct {
739741 color_attr_on(COLOR_PAIR(HSTR_COLOR_INFO));
740742 color_attr_on(A_BOLD);
741743 }
742 mvprintw(hstr->promptYNotification, 0, screenLine);
744 mvprintw(hstr->promptYNotification, 0, "%s", screenLine);
743745 if(hstr->theme & HSTR_THEME_COLOR) {
744746 color_attr_off(A_BOLD);
745747 color_attr_on(COLOR_PAIR(HSTR_COLOR_NORMAL));
16671669 void hstr_getopt(int argc, char **argv)
16681670 {
16691671 int option_index = 0;
1670 int option = getopt_long(argc, argv, "fkVhnszb", long_options, &option_index);
1672 int option = getopt_long(argc, argv, "fkVhnszbi", long_options, &option_index);
16711673 if(option != -1) {
16721674 switch(option) {
16731675 case 'f':
16891691 blacklist_dump(&hstr->blacklist);
16901692 hstr_exit(EXIT_SUCCESS);
16911693 break;
1694 case 'i':
1695 fill_terminal_input(optarg, FALSE);
1696 hstr_exit(EXIT_SUCCESS);
1697 break;
16921698 case 'V':
16931699 printf("%s", VERSION_STRING);
16941700 hstr_exit(EXIT_SUCCESS);
00 /*
11 hstr_blacklist.c commands to be skipped from history
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
7373 fileContent[fileSize] = 0;
7474
7575 if(fileContent && strlen(fileContent)) {
76 char *p=strchr(fileContent,'\n');
77 while (p!=NULL) {
78 p=strchr(p+1,'\n');
79 }
80 char *pb=fileContent, *pe, *s;
76 char *pb=fileContent, *pe;
8177 pe=strchr(fileContent, '\n');
8278 while(pe!=NULL) {
8379 *pe=0;
8480 if(!hashset_contains(blacklist->set,pb)) {
85 s=hstr_strdup(pb);
86 hashset_add(blacklist->set,s);
81 hashset_add(blacklist->set,pb);
8782 }
8883 pb=pe+1;
8984 pe=strchr(pb, '\n');
150145 exit(EXIT_FAILURE);
151146 }
152147 }
148 free(keys[i]);
153149 }
154150 fclose(outputFile);
151 free(keys);
155152 } else {
156153 if(access(fileName, F_OK) != -1) {
157154 FILE *outputFile = fopen(fileName, "wb");
11 hstr_curses.c Curses utilities
22 http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html
33
4 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
4 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
55
66 Licensed under the Apache License, Version 2.0 (the "License");
77 you may not use this file except in compliance with the License.
00 /*
11 hstr_favorites.c favorite commands
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_history.c loading and processing of BASH history
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
100100
101101 char* parse_history_line(char *l)
102102 {
103 #ifndef HSTR_TESTS_UNIT
104 static bool isZsh, c;
105 if(!c) {
106 isZsh=isZshParentShell();
107 c=true;
108 }
109 #endif
110
103111 if(
104112 #ifndef HSTR_TESTS_UNIT
105 !isZshParentShell() ||
113 !isZsh ||
106114 #endif
107115 !l ||
108116 l[0]!=':') {
125133 if(*pt==';')
126134 return ++pt;
127135 }
136 }
137
138 if (isZsh) {
139 l = zsh_unmetafy(l, NULL);
128140 }
129141
130142 return l;
389401
390402 void history_mgmt_flush(void)
391403 {
392 if(dirty) {
404 if(dirty && !isZshParentShell()) {
393405 fill_terminal_input("history -r\n", false);
394406 }
395407 }
00 /*
11 hstr_regexp.c simplified regexp that suits HSTR needs - matching and caching
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_utils.c utilities
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
233233 free(cmdline);
234234 return result;
235235 }
236
237 /* See zsh utils.c https://github.com/zsh-users/zsh/blob/master/Src/utils.c#L4922 */
238 char* zsh_unmetafy(char* s, int* len)
239 {
240 char *p, *t;
241
242 for (p = s; *p && *p != ZSH_META; p++);
243 for (t = p; (*t = *p++);)
244 if (*t++ == ZSH_META)
245 t[-1] = *p++ ^ 32;
246 if (len)
247 *len = t - s;
248
249 return s;
250 }
00 /*
11 hashset.h header file for hash set
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr.h header file for HSTR shell history completion utility
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_blacklist.h header file for commands to be skipped from history
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_curses.h header file for curses helpers
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_favorites.h header file for favorite commands
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_history.h header file for loading and processing of BASH history
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_regexp.h header file for simplified regexp that suits HSTR needs
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 hstr_utils.h header file for HSTR utilities
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
3030 #define ENV_VAR_HOME "HOME"
3131
3232 #define UNUSED_ARG(expr) do { (void)(expr); } while (0)
33 #define ZSH_META ((char) 0x83)
3334
3435 #define MIN(a,b) (((a)<(b))?(a):(b))
3536 #define MAX(a,b) (((a)>(b))?(a):(b))
4748 char* get_home_file_path(char* filename);
4849 void toggle_case(char* str, bool lowercase);
4950 bool isZshParentShell(void);
51 char* zsh_unmetafy(char* s, int* len);
5052
5153 #endif
00 /*
11 radixsort.h header file for radix sort implementation
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 main.c HSTR shell history completion utility main
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 radixsort.c radix sort
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 # hstr-unit-tests.pro Qt project file of UNIT tests for HSTR
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 /*
11 test.c UNIT tests main for HSTR shell history completion utility
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 test_*.c HSTR test
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 test_*.c HSTR test
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 test_*.c HSTR test
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 /*
11 test_*.c HSTR test
22
3 Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
3 Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
00 #!/bin/bash
11 #
2 # Copyright (C) 2014-2020 Martin Dvorak <martin.dvorak@mindforger.com>
2 # Copyright (C) 2014-2021 Martin Dvorak <martin.dvorak@mindforger.com>
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.