Posts tagged: zsh

All posts with the tag "zsh"

2 posts latest post 2026-06-29
Publishing rhythm
Jun 2026 | 1 posts

This morning I had a machine crash on me and came back to an error.

Error

zsh: corrupt history file /home/u_walkews/.zsh_history

Dammit I don’t want to redo my shell history, I checked with a clanker and they came up with this solution using strings that only prints printable characters.

cp ~/.zsh_history ~/.zsh_history.bak
mv ~/.zsh_history ~/.zsh_history.corrupt
touch ~/.zsh_history
chmod 600 ~/.zsh_history
strings ~/.zsh_history.corrupt > ~/.zsh_history
chmod 600 ~/.zsh_history
[1] Wincent (Greg Hurrel) has a pretty solid and fast zshrc. I recently grabbed his completion section and it seems to be working better than whatever I had. zsh completion snippet # # Completion # fpath=($HOME/.zsh/completions $fpath) autoload -U compinit compinit -u # Make completion: # - Try exact (case-sensitive) match first. # - Then fall back to case-insensitive. # - Accept abbreviations after . or _ or - (ie. f.b -> foo.bar). # - Substring complete (ie. bar -> foobar). zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]}' '+m:{[:upper:]}={[:lower:]}' '+m:{_-}={-_}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' # Colorize completions using default `ls` colors. zstyle ':completion:*' list-colors '' # Allow completion of ..<Tab> to ../ and beyond. zstyle -e ':completion:*' special-dirs '[[ $PREFIX = (../)#(..) ]] && reply=(..)' # $CDPATH is overpowered (can allow us to jump to 100s of directories) so tends # to dominate completion; exclude path-directories from the tag-order so that # they will only be used as a fallback if no completions are found. zstyle ':completion:*:complete:(cd|pushd):*' tag-order 'local-directories named-directories' # Categorize completion...