Compare commits

...

3 Commits

Author SHA1 Message Date
Kipras Melnikovas
cce56babbe
Merge f36e40f3d70a5d0ef50353087d5cdeeef0e446b3 into b545443993b1fed2665a9359033ccd2fea5efb8f 2024-05-11 12:38:23 +00:00
fennomaani
b545443993
Save command to history before it is executed (#1409) 2024-05-11 12:35:28 +00:00
Kipras Melnikovas
f36e40f3d7
shortcuts: fix file removal - do not remove /dev/null
as a non-root user, this would be fine.

but, i was setting up a docker container for development [1], and upon
running a login shell, the shortcuts script would get invoked,
and would remove /dev/null (and later re-create it), which changes its
type from a character device into a regular file, thus breaking the
system (e.g. apt update wouldn't work anymore).

[1] https://github.com/kiprasmel/infra/blob/master/local/devel-core-git/Dockerfile
2024-03-21 00:44:06 +02:00
2 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@ setopt interactive_comments
HISTSIZE=10000000
SAVEHIST=10000000
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
setopt inc_append_history
# Load aliases and shortcuts if existent.
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"

View File

@ -14,7 +14,10 @@ fish_shortcuts="/dev/null"
vifm_shortcuts="/dev/null"
# Remove, prepare files
rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
for file in "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts"; do
test -f "$file" && rm -f "$file" 2>/dev/null
done
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"