Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xav-b/zsh-extend-history
Zsh plugin to record command history with more context
https://github.com/xav-b/zsh-extend-history
Last synced: about 1 month ago
JSON representation
Zsh plugin to record command history with more context
- Host: GitHub
- URL: https://github.com/xav-b/zsh-extend-history
- Owner: xav-b
- Created: 2018-05-05T08:42:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T11:25:31.000Z (almost 3 years ago)
- Last Synced: 2024-01-24T18:56:02.159Z (4 months ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Lists
- awesome-zsh-plugins - extend-history - Extends command history by adding the exit code for each command in the history. (Plugins / ZSH on Windows)
- awesome-stars - xav-b/zsh-extend-history - Zsh plugin to record command history with more context (Shell)
- fucking-awesome-zsh-plugins - extend-history - Extends command history by adding the exit code for each command in the history. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - extend-history - Extends command history by adding the exit code for each command in the history. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - extend-history - Extends command history by adding exit code for each command in the history. (Plugins / Zinit (née zplugin))
README
# Contextual shell history - Zsh Plugin
### Install
- Antigen: `antigen bundle xav-b/zsh-extend-history`
- ZPlug: `zplug "xav-b/zsh-extend-history"`
- oh-my-zsh:```Shell
$ git clone https://github.com/xav-b/zsh-extend-history ~/.oh-my-zsh/custom/plugins/extend-history
```And add `extend-history` to `plugins` in `.zshrc`.
### Configuration
```Zsh
# file to write history
# default to `$HOME/.zsh_extended_history`
export ZSH_EXTEND_HISTORY_FILE="/tmp/my-zsh.history"# print history collected on stdout instead of file
export ZSH_EXTEND_HISTORY_DEBUG="true"
```### Development
Just source the file everytime you test changes =)
Something like that can help: `tail -f $ZSH_EXTEND_HISTORY_FILE | ./stream.py`
### Ideas/Notes
- vim and other long-lasting commands is an issue for the start and end
hooks (other commands will probably happen in the meantime). We should
instead compute a unique id that the `end` can refer too, and use it
to retrieve the start stored in a temporary place (/tmp/gi/{this-id}.cmd).- the `end` command sometimes appear on a seperate line (most probably
related)- option to ignore "boring commands" (ls, cd, ...)
- command to nicely display in the terminal? (or put that in gi)
- session id
- Deduplicate
- Only search/display history per directory/git project