Overview
hline is designed to work with minimal configuration. It reads your bash history file directly and doesn’t require a separate configuration file.History file location
Default path
When you runhline without arguments, it automatically locates your bash history:
- Checks the
HOMEenvironment variable - Constructs the path as
$HOME/.bash_history - Falls back to
./.bash_historyifHOMEis not set
history.rs:11-16.
Custom path
You can specify a different history file using the--file flag:
- Browsing history from different shells (zsh, fish, etc.)
- Reviewing history from other users
- Reading command logs from custom locations
Environment variables
Standard environment variable pointing to your home directory.hline uses this to construct the default history path:
$HOME/.bash_historyIf HOME is not set, hline falls back to ./.bash_history in the current directory.History file format
hline expects a plain text file with one command per line, matching the standard bash history format.Supported format
Timestamp entries
Bash can optionally store timestamps in the history file whenHISTTIMEFORMAT is set. These appear as lines starting with # followed by a Unix timestamp:
history.rs:41-47).
Line processing
When loading your history file, hline:- Strips carriage returns (
\r) from line endings for cross-platform compatibility - Skips timestamp lines (lines matching
#<digits>) - Filters out empty lines
- Reverses the order so the most recent commands appear first
history.rs:18-39.
Shell integration
Bash configuration
To get the most out of hline, configure bash to maintain a comprehensive history:Other shells
While hline is optimized for bash history, you can browse history from other shells by pointing to their history files:Zsh and Fish use different history formats with metadata. You may see extra formatting characters when browsing their history files with hline.