Skip to content

Commit 68aa0d6

Browse files
committed
fix history using PROMPT_COMMAND
1 parent 921c2d6 commit 68aa0d6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.devcontainer/features/bash-config/config/bash-config-rc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
# default opinioned bash configuration
44

5-
# set the prompt
6-
export PS1="\[\033[1;34m\]\W \[\033[0m\]# "
7-
85
# enable enternal shared history
96
export HISTCONTROL=ignoreboth:erasedups
107
export HISTSIZE=-1
118
export HISTFILESIZE=-1
129
export SAVEHIST=-1
1310
export HISTFILE=$CONFIG_FOLDER/.bash_eternal_history
11+
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
1412

1513
# bash theme - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
1614
# from https://github.com/devcontainers/features/blob/main/src/common-utils/scripts/bash_theme_snippet.sh

.devcontainer/features/bash-config/config/onCreateCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ if [[ ! -f $CONFIG_FOLDER/bashrc ]] ; then
1212
fi
1313

1414
# hook in the config to the root account
15-
ln -s $CONFIG_FOLDER/inputrc /root/.inputrc
15+
ln -fs $CONFIG_FOLDER/inputrc /root/.inputrc
1616
echo "source $CONFIG_FOLDER/bashrc" >> /root/.bashrc

0 commit comments

Comments
 (0)