Skip to content

Commit

Permalink
Keep fish history across restarts
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Apr 9, 2024
1 parent a9a8d42 commit 5b36c3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ddev/addon-metadata/pimp-my-shell/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pimp-my-shell
repository: .
version: ""
install_date: "2024-04-09T17:47:01-03:00"
install_date: "2024-04-09T19:59:24-03:00"
project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell.sh
Expand Down
7 changes: 7 additions & 0 deletions .ddev/homeadditions/.config/fish/conf.d/pimp-my-shell.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ mkdir -p /mnt/ddev-global-cache/z.lua/$HOSTNAME
set -x _ZL_DATA /mnt/ddev-global-cache/z.lua/$HOSTNAME/.zlua
lua /opt/z.lua/z.lua --init fish | source

# fish
mkdir -p /mnt/ddev-global-cache/fishhistory/$HOSTNAME
# workaround to keep the history file accross restarts
[ -f ~/.local/share/fish/fish_history ] && [ ! -L ~/.local/share/fish/fish_history ] && mv ~/.local/share/fish/fish_history /mnt/ddev-global-cache/fishhistory/$HOSTNAME/fish_history
[ ! -f ~/.local/share/fish/fish_history ] && touch /mnt/ddev-global-cache/fishhistory/$HOSTNAME/fish_history
ln -fs /mnt/ddev-global-cache/fishhistory/$HOSTNAME/fish_history ~/.local/share/fish/fish_history

function fish_title
echo "$DDEV_PROJECT ddev@"(fish_prompt_pwd_dir_length=1 prompt_pwd) - $argv
end
7 changes: 7 additions & 0 deletions homeadditions/.config/fish/conf.d/pimp-my-shell.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ mkdir -p /mnt/ddev-global-cache/z.lua/$HOSTNAME
set -x _ZL_DATA /mnt/ddev-global-cache/z.lua/$HOSTNAME/.zlua
lua /opt/z.lua/z.lua --init fish | source

# fish
mkdir -p /mnt/ddev-global-cache/fishhistory/$HOSTNAME
# workaround to keep the history file accross restarts
[ -f ~/.local/share/fish/fish_history ] && [ ! -L ~/.local/share/fish/fish_history ] && mv ~/.local/share/fish/fish_history /mnt/ddev-global-cache/fishhistory/$HOSTNAME/fish_history
[ ! -f ~/.local/share/fish/fish_history ] && touch /mnt/ddev-global-cache/fishhistory/$HOSTNAME/fish_history
ln -fs /mnt/ddev-global-cache/fishhistory/$HOSTNAME/fish_history ~/.local/share/fish/fish_history

function fish_title
echo "$DDEV_PROJECT ddev@"(fish_prompt_pwd_dir_length=1 prompt_pwd) - $argv
end

0 comments on commit 5b36c3e

Please sign in to comment.