From 5729d64733b243285bafcbda187465bc4a5a407b Mon Sep 17 00:00:00 2001 From: giles knap Date: Sun, 22 Dec 2024 21:14:25 +0000 Subject: [PATCH 1/2] add eternal history to zsh where already present --- .../bash-config/config/onCreateCommand.sh | 4 +++- .devcontainer/features/bash-config/config/zshrc | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/features/bash-config/config/zshrc diff --git a/.devcontainer/features/bash-config/config/onCreateCommand.sh b/.devcontainer/features/bash-config/config/onCreateCommand.sh index 6de479a..12a81cc 100644 --- a/.devcontainer/features/bash-config/config/onCreateCommand.sh +++ b/.devcontainer/features/bash-config/config/onCreateCommand.sh @@ -9,8 +9,10 @@ cp $CONFIG_STAGING/bash-config-rc $CONFIG_FOLDER if [[ ! -f $CONFIG_FOLDER/bashrc ]] ; then cp $CONFIG_STAGING/bashrc $CONFIG_FOLDER cp $CONFIG_STAGING/inputrc $CONFIG_FOLDER + cp $CONFIG_STAGING/zshrc $CONFIG_FOLDER fi # hook in the config to the root account ln -fs $CONFIG_FOLDER/inputrc /root/.inputrc -echo "source $CONFIG_FOLDER/bashrc" >> /root/.bashrc \ No newline at end of file +echo "source $CONFIG_FOLDER/bashrc" >> /root/.bashrc +echo "source $CONFIG_FOLDER/zshrc" >> /root/.zshrc \ No newline at end of file diff --git a/.devcontainer/features/bash-config/config/zshrc b/.devcontainer/features/bash-config/config/zshrc new file mode 100644 index 0000000..e3f0044 --- /dev/null +++ b/.devcontainer/features/bash-config/config/zshrc @@ -0,0 +1,16 @@ +# This zshrc will be source from /root/.zshrc upon launch of every terminal +# in a devcontainer that uses the bash-config feature from +# https://github.com/DiamondLightSource/devcontainer-features + +# This file is initialized by vscode feature bash-config, +# but you are then free to edit it + +# set up eternal history for zsh +export HISTCONTROL=ignoreboth:erasedups +export HISTSIZE=-1 +export HISTFILESIZE=-1 +export SAVEHIST=-1 +export HISTFILE=$CONFIG_FOLDER/.zsh_eternal_history + +# set a theme compatible with vscode terminals +ZSH_THEME="dst" From 9d9af67505ee325574527ad2bb44e81c52ef5ec2 Mon Sep 17 00:00:00 2001 From: giles knap Date: Sun, 22 Dec 2024 21:30:16 +0000 Subject: [PATCH 2/2] correct zsh history settings --- .devcontainer/features/bash-config/config/zshrc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.devcontainer/features/bash-config/config/zshrc b/.devcontainer/features/bash-config/config/zshrc index e3f0044..3bb6cfd 100644 --- a/.devcontainer/features/bash-config/config/zshrc +++ b/.devcontainer/features/bash-config/config/zshrc @@ -6,11 +6,10 @@ # but you are then free to edit it # set up eternal history for zsh -export HISTCONTROL=ignoreboth:erasedups -export HISTSIZE=-1 -export HISTFILESIZE=-1 -export SAVEHIST=-1 -export HISTFILE=$CONFIG_FOLDER/.zsh_eternal_history +HISTCONTROL=ignoreboth:erasedups +HISTSIZE=10000000 +SAVEHIST=$HISTSIZE +HISTFILE=$CONFIG_FOLDER/.zsh_eternal_history # set a theme compatible with vscode terminals ZSH_THEME="dst"