Settings in .bashrc
:
# separate history files
HISTFILE=$HOME/.history/$(date +%y%m%d.%H%M%S).$USER.$TERM.$SSH_PORT.$$
# Ignore duplicate commands
export HISTCONTROL=ignoredups
# Save history after each command (when new prompt is displayed)
PROMPT_COMMAND="$PROMPT_COMMAND;history -a; history -n"
- Do not use
ignoredups
but periodically copy history file content as a command log and deduplicate the original history file.
// settings.json
"terminal.integrated.profiles.linux": {
"bash1": {
"path": "bash",
"args": ["--rcfile", "${workspaceFolder}/.vscode/.bashrc1"]
},
"bash2": {
"path": "bash",
"args": ["--rcfile", "${workspaceFolder}/.vscode/.bashrc2"]
}
}