Home

Awesome

zsh-history-on-success

Zsh plugin for filtering the commands saved to your zsh history file

Save yourself from repeating the same mistakes by filtering out your unsuccessful commands from your zsh history file.

The original code was written by Dean Scarff from this blog post. Some further features have been added.

Features

  1. Saves commands that exited successfully to your zsh history file.
  2. Saves commands that exited with Ctrl+C and have been running for longer than the Ctrl+C duration (configurable with environment variables). Useful for saving commands that do not exit like running a web server.

Install

Run this command to install this plugin if you are using Oh My Zsh.

git -C "${ZSH_CUSTOM:-${ZSH:-$HOME/.oh-my-zsh}/custom}/plugins" clone --depth=1 https://github.com/nyoungstudios/zsh-history-on-success

Configuration

This plugin can be configured with environment variables.