Skip to content

Commit

Permalink
Isolated shell history.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Dec 31, 2023
1 parent 050ff3e commit bfecafc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.swp
*.map
install.sh
.zcompdump
.zcompdump
.zsh_history
1 change: 1 addition & 0 deletions nix/env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ pkgs.mkShell {
export ZDOTDIR=$PWD/nix/zsh
export XDG_CONFIG_HOME=$PWD/nix
export PATH=$PWD:$PATH
export SOURCE_DIR=$(./shx sourceDir)
'';
}
2 changes: 1 addition & 1 deletion nix/zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bindkey -e
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
HISTFILE=$SOURCE_DIR/.zsh_history
# Use modern completion system
autoload -Uz compinit
compinit
Expand Down
3 changes: 2 additions & 1 deletion sh/sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ if [ -e "$(which nix-shell)" ]; then
echo "Preparing Nix shell with: ${useNix}.nix..."
nix-shell nix/${useNix}.nix --quiet --pure --command zsh
echo "Quitting Nix shell..."
rm nix/zsh/.zcompdump
rm nix/.zcompdump 2> /dev/null
rm nix/zsh/.zcompdump 2> /dev/null
else
echo "${useNix}.nix does not exist."
fi
Expand Down
5 changes: 5 additions & 0 deletions sh/sourceDir.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# This script is to display the project directory.
# It is solely used to support shell history isolation.
echo $SOURCE_DIR
exit

0 comments on commit bfecafc

Please # to comment.