diff --git a/plugins/terminal/resources/jediterm-bash.in b/plugins/terminal/resources/jediterm-bash.in index 4f619a73d60a..31defa7d2d35 100644 --- a/plugins/terminal/resources/jediterm-bash.in +++ b/plugins/terminal/resources/jediterm-bash.in @@ -70,12 +70,11 @@ function configureCommandHistory { local commandHistoryFile="$__INTELLIJ_COMMAND_HISTFILE__" if [ -n "$commandHistoryFile" ] && [ -z "`trap -p EXIT`" ] then - if [ ! -s "$commandHistoryFile" ] && [ -f "$HISTFILE" ] + trap "history -w \"$commandHistoryFile\"; export HISTFILE=\"$HISTFILE\"" EXIT + if [ -s "$commandHistoryFile" ] then - command cp "$HISTFILE" "$commandHistoryFile" + export HISTFILE="$commandHistoryFile" fi - trap "history -w \"$HISTFILE\"" EXIT - export HISTFILE="$commandHistoryFile" fi } configureCommandHistory