Getting ready for 2.1 release & zsh/Zsh bash/Bash

This commit is contained in:
Martin Dvorak 2019-12-08 21:14:23 +01:00
parent c367541799
commit fc81bbd4c6
10 changed files with 33 additions and 27 deletions

View file

@ -1,3 +1,7 @@
2019-12-08 Martin Dvorak <martin.dvorak@mindforger.com>
* Released v2.1.0 - significant zsh support improvements and stabilization.
2018-08-28 Martin Dvorak <martin.dvorak@mindforger.com>
* Released v2.0.0 - Major release which resolves confusing hstr/hh ambuiguity by choosing
@ -30,7 +34,7 @@
2017-01-21 Martin Dvorak <martin.dvorak@mindforger.com>
* Released v1.22 - Zsh history mgmt improvements (delete).
* Released v1.22 - zsh history mgmt improvements (delete).
2016-11-22 Martin Dvorak <martin.dvorak@mindforger.com>

View file

@ -4,7 +4,7 @@
# Contributor: Busindre <busilezas at busindre.com>
pkgname=hstr
pkgver=2.0
pkgver=2.1
pkgrel=1
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."
arch=('any')

View file

@ -147,8 +147,8 @@ then
exit 1
fi
export ARG_BAZAAR_MSG="HSTR 2.0.0"
export ARG_VERSION="2.0.0"
export ARG_BAZAAR_MSG="HSTR 2.1.0"
export ARG_VERSION="2.1.0"
# Debian releases: https://www.debian.org/releases/
# 6/7/8/9/10: squeeze wheezy jessie stretch buster

View file

@ -20,7 +20,7 @@
# This script is available from http://www.mindforger.com/fedora/fedora-rpm-from-deb.sh
# to be easily available in VMs
export MFVERSION="2.0.0"
export MFVERSION="2.1.0"
export MFPRJNAME="hstr-${MFVERSION}"
export AMD64NAME="hstr_${MFVERSION}-1_amd64"
export I386NAME="hstr_${MFVERSION}-1_i386"

View file

@ -20,7 +20,7 @@
export SCRIPT_HOME=`pwd`
export HSTR_VERSION="2.0.0"
export HSTR_VERSION="2.1.0"
export NOW=`date +%Y-%m-%d--%H-%M-%S`
export GH_RELEASE_DIR=~/p/hstr/release

View file

@ -163,9 +163,9 @@ then
exit 1
fi
export ARG_BAZAAR_MSG="Release 2.0"
export ARG_MAJOR_VERSION=2.0.
export ARG_MINOR_VERSION=12 # minor version is incremented for every Ubuntu version
export ARG_BAZAAR_MSG="Release 2.1"
export ARG_MAJOR_VERSION=2.1.
export ARG_MINOR_VERSION=0 # minor version is incremented for every Ubuntu version
# https://wiki.ubuntu.com/Releases
# old: precise quantal saucy precise utopic vivid wily yakkety artful cosmic

View file

@ -20,7 +20,7 @@
AC_PREREQ([2.69])
AC_INIT(hstr, 2.0.0, martin.dvorak@mindforger.com)
AC_INIT(hstr, 2.1.0, martin.dvorak@mindforger.com)
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
# Check src dir existence.

View file

@ -178,7 +178,7 @@ shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
# ensure synchronization between Bash memory and history file
# ensure synchronization between bash memory and history file
export PROMPT_COMMAND="history \-a; history \-n; ${PROMPT_COMMAND}"
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc)
if [[ $\- =~ .*i.* ]]; then bind '"\eC\-r": "\eC\-a hstr -- \eC-j"'; fi
@ -188,8 +188,8 @@ if [[ $\- =~ .*i.* ]]; then bind '"\eC\-r": "\eC\-a hstr -- \eC-j"'; fi
Optionally add the following lines to ~/.zshrc:
.nf
.sp
export HISTFILE=~/.zsh_history # ensure history file visibility
export HSTR_CONFIG=hicolor # get more colors
export HSTR_CONFIG=hicolor # get more colors
setopt histignorespace # skip cmds w/ leading space from history
bindkey -s "\eC\-r" "\eC\-a hstr \-\- \eC\-j" # bind hstr to Ctrl-r (for Vi mode check doc)
.sp
.fi
@ -205,7 +205,9 @@ bindkey -s "\eC\-r" "\eC\-a hstr \-\- \eC\-j" # bind hstr to Ctrl-r (for Vi mode
Print history items containing 'git' to standard output and exit.
.TP
\fBhstr --show-configuration >> ~/.bashrc\fR
Append default \fBhstr\fR configuration to your Bash profile.
Append default \fBhstr\fR configuration to your bash profile.
\fBhstr --show-configuration >> ~/.zhrc\fR
Append default \fBhstr\fR configuration to your zsh profile.
.TP
\fBhstr --show-blacklist\fR
Show blacklist configured for history processing.

View file

@ -51,7 +51,7 @@
</Company_Info>
<Program_Info>
<Program_Name>HSTR</Program_Name>
<Program_Version>2.0.0</Program_Version>
<Program_Version>2.1.0</Program_Version>
<Program_Release_Month>08</Program_Release_Month>
<Program_Release_Day>30</Program_Release_Day>
<Program_Release_Year>2018</Program_Release_Year>

View file

@ -133,7 +133,7 @@
// major.minor.revision
static const char* VERSION_STRING=
"hstr version \"2.0.0\" (2018-08-28T13:30:00)"
"hstr version \"2.1.0\" (2019-12-08T13:30:00)"
"\n";
static const char* HSTR_VIEW_LABELS[]={
@ -165,12 +165,12 @@ static const char* INSTALL_BASH_STRING=
// 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)
// 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)
// across different bash sessions.
// -c -r ... Forces entire .bash_history to be reloaded (handles history deletes, synchronizes different bash sessions)
"\n# ensure synchronization between Bash memory and history file"
"\nexport PROMPT_COMMAND=\"history -a; history -n; ${PROMPT_COMMAND}\""
"\n# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc)"
@ -209,10 +209,10 @@ static const char* INSTALL_ZSH_STRING=
"\nexport HISTFILE=~/.zsh_history # ensure history file visibility"
"\nexport HSTR_CONFIG=hicolor # get more colors"
#if defined(__MS_WSL__)
// TODO binding to be rewritten for zsh@WSL as it's done for Bash - hstr_winwsl() like function to be implemented to make it work on WSL
// TODO binding to be rewritten for zsh@WSL as it's done for bash - hstr_winwsl() like function to be implemented to make it work on WSL
"\n# Function and binding below is Bash script that makes command completion work under WSL."
"\n# If you can rewrite the function and binding from Bash to zsh please send it to martin.dvorak@mindforger.com"
"\n# Function and binding below is bash script that makes command completion work under WSL."
"\n# If you can rewrite the function and binding from bash to zsh please send it to martin.dvorak@mindforger.com"
"\n# so that I can share it with other users."
"\n#function hstr_winwsl {"
"\n# offset=${READLINE_POINT}"
@ -224,10 +224,10 @@ static const char* INSTALL_ZSH_STRING=
"\n"
"\nbindkey -s \"\\C-r\" \"\\eqhstr\\n\" # bind hstr to Ctrl-r (for Vi mode check doc)"
#elif defined(__CYGWIN__)
// TODO binding to be rewritten for zsh@Cygwin as it's done for Bash - hstr_cygwin() like function to be implemented to make it work under Cygwin
// TODO binding to be rewritten for zsh@Cygwin as it's done for bash - hstr_cygwin() like function to be implemented to make it work under Cygwin
"\n# Function and binding below is Bash script that makes command completion work under Cygwin."
"\n# If you can rewrite the function and binding from Bash to zsh please send it to martin.dvorak@mindforger.com"
"\n# Function and binding below is bash script that makes command completion work under Cygwin."
"\n# If you can rewrite the function and binding from bash to zsh please send it to martin.dvorak@mindforger.com"
"\n# so that I can share it with other users."
"\n#function hstr_cygwin {"
"\n# offset=${READLINE_POINT}"
@ -256,7 +256,7 @@ static const char* HELP_STRING=
"\n --kill-last-command -k ... delete last command in history"
"\n --non-interactive -n ... print filtered history and exit"
"\n --show-configuration -s ... show configuration to be added to ~/.bashrc"
"\n --show-zsh-configuration -z ... show Zsh configuration to be added to ~/.zshrc"
"\n --show-zsh-configuration -z ... show zsh configuration to be added to ~/.zshrc"
"\n --show-blacklist -b ... show commands to skip on history indexation"
"\n --version -V ... show version details"
"\n --help -h ... help"
@ -1533,7 +1533,7 @@ void hstr_getopt(int argc, char **argv)
printf("%s", INSTALL_ZSH_STRING);
exit(EXIT_SUCCESS);
case 's':
// ZSH_VERSION is not exported by Zsh > detected by parent process name
// ZSH_VERSION is not exported by zsh > detected by parent process name
if(isZshParentShell()) {
printf("%s", INSTALL_ZSH_STRING);
} else {