bash and zsh shell history suggest box - easily view, navigate, search and manage your command history.
Go to file
Thibault Charbonnier 5ab8205859
Fix of wrong zsh extended history (with timestamps) SEGFAULT and parsing #409 (#410)
This patch fixes a segfault when .zsh_history contains commands starting
with `:` and longer than 15 characters long.

Considering the history line:

    : 1592444398:0;:vspman epoll_ctl

The ranked item's line will be:

    :vspman epoll_ctl

When building the prioritized history, we used to apply the zsh extended
history offset if the line starts with `:` (and if the command is longer
than `15`, defined by `ZSH_HISTORY_ITEM_OFFSET`), which then makes the
item point to:

    tl

This makes the `r->item` pointer invalid, which causes the segfault
observed in #408 within `prioritized_history_destroy`.

---

This patch prevents the same issue from arising again (even if the
line is wrongly interpreted) since it avoids any pointer arithmetic
between assignment and freeing.

Additionally, the patch also greatly improves the heuristics used in
determining whether a line is of extended history format or not, since
the non-extended format is also supported by zsh.

---

Fix #410
Fix #399
2020-11-19 07:13:30 +01:00
build Adding focal Ubuntu distro. 2020-05-13 21:41:27 +02:00
doc Finishing bash/Bash convetions. 2019-12-16 22:40:43 +01:00
etc/bash-completion.d Polishing sources (copyrights, test refactoring). 2019-12-21 07:53:11 +01:00
man Finishing bash/Bash convetions. 2019-12-16 22:40:43 +01:00
snap Polishing sources (copyrights, test refactoring). 2019-12-21 07:53:11 +01:00
src Fix of wrong zsh extended history (with timestamps) SEGFAULT and parsing #409 (#410) 2020-11-19 07:13:30 +01:00
test Fix of wrong zsh extended history (with timestamps) SEGFAULT and parsing #409 (#410) 2020-11-19 07:13:30 +01:00
.gitignore Ensuring hstr won't be shown in history, fixed correct history file in zsh which resolves #317 2019-12-08 20:48:05 +01:00
.travis.yml Polishing sources (copyrights, test refactoring). 2019-12-21 07:53:11 +01:00
_config.yml Set theme jekyll-theme-hacker 2017-11-01 12:06:02 +01:00
Changelog Fixing various memory leaks #370 2019-12-21 08:54:56 +01:00
CONFIGURATION.md Fixing CONFIGURATION.md TOC links and sections order. 2019-12-16 22:04:26 +01:00
configure.ac Fixing various memory leaks #370 2019-12-21 08:54:56 +01:00
hstr.pro Polishing sources (copyrights, test refactoring). 2019-12-21 07:53:11 +01:00
INSTALLATION.md Adding full alternative to edit source.list in debian (#396) 2020-04-20 22:10:56 +02:00
LICENSE Initial commit 2013-12-02 14:47:51 -08:00
Makefile.am Adding excluded Bash autocomplete configuration. 2018-08-26 17:02:48 +02:00
pad.xml Polishing sources (copyrights, test refactoring). 2019-12-21 07:53:11 +01:00
PKGBUILD Update sha256sum 2019-12-23 14:47:01 +01:00
README.md Tuxdiary doesn't work using HTTPS 2020-01-20 00:56:59 +02:00

HSTR

Travis CI Current release GitHub issues All releases downloads License

Easily view, navigate and search your command history with shell history suggest box for bash and zsh.

Shell History Suggest Box

Description

Are you looking for a command that you used recently? Do you want to avoid the need to write long commands over and over again? Are you looking for a tool that is able to manage your favorite commands?

HSTR (HiSToRy) is a command line utility that brings improved bash/zsh command completion from the history. It aims to make completion easier and more efficient than Ctrl-r.

HSTR can also manage your command history (for instance you can remove commands that are obsolete or contain a piece of sensitive information) or bookmark your favorite commands.

Installation

Install:

Build:

Tarball:

Configuration

Configure HSTR just by running:

# bash
hstr --show-configuration >> ~/.bashrc

# zsh
hstr --show-configuration >> ~/.zshrc

For detailed HSTR configuration documentation please refer to Configuration.

Documentation

Check man page:

man hstr

In the News

Read about HSTR in LinuxMagazine, UbuntuGeek, DebianAdmin, Tuxdiary, Softpedia and OSTechNix.

Upgrade

If you are HSTR 1.x user, please read about HSTR 2.x changes.

Bugs

https://github.com/dvorka/hstr/issues