Fix tramp creating random files

This commit is contained in:
Alexander Rosenberg 2025-02-22 03:49:54 -08:00
parent 1af11843ad
commit 645a6858b6
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -55,8 +55,23 @@ unsetopt beep notify
# Some general, random configuration
# History stuff
if [[ -v INSIDE_EMACS ]]; then
() {
emulate -L zsh
set -o rematchpcre
if [[ "${HISTFILE}" =~ '^~([^/]*)($|/.*)' ]]; then
local user="${match[1]}"
local rest="${match[2]}"
if [[ -z "${user}" ]]; then
HISTFILE="${HOME}${rest}"
else
HISTFILE="${userdirs[${user}]}"
fi
fi
}
fi
[[ "${HISTFILE}" == '~'* ]] && HISTFILE="${HISTFILE}"
[ -v HISTFILE ] || HISTFILE="${HOME}/.cache/zsh/history"
[ ! -d "${HISTFILE:h}" ] && mkdir -p "${HISTFILE:h}"
HISTSIZE=1000
SAVEHIST=10000