File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/vs/workbench/contrib/terminal/browser/media Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1414# as disable it by unsetting the variable.
1515VSCODE_SHELL_INTEGRATION=1
1616
17+ # By default, zsh will set the $HISTFILE to the $ZDOTDIR location automatically. In the case of the
18+ # shell integration being injected, this means that the terminal will use a different history file
19+ # to other terminals. To fix this issue, set $HISTFILE back to the default location before ~/.zshrc
20+ # is called as that may depend upon the value.
21+ if [[ " $VSCODE_INJECTION " == " 1" ]]; then
22+ HISTFILE=$USER_ZDOTDIR /.zsh_history
23+ fi
24+
1725# Only fix up ZDOTDIR if shell integration was injected (not manually installed) and has not been called yet
1826if [[ " $VSCODE_INJECTION " == " 1" ]]; then
1927 if [[ $options [norcs] = off && -f $USER_ZDOTDIR /.zshrc ]]; then
2028 VSCODE_ZDOTDIR=$ZDOTDIR
2129 ZDOTDIR=$USER_ZDOTDIR
30+ # A user's custom HISTFILE location might be set when their .zshrc file is sourced below
2231 . $USER_ZDOTDIR /.zshrc
2332 ZDOTDIR=$VSCODE_ZDOTDIR
2433 fi
25-
26- if [[ -f $USER_ZDOTDIR /.zsh_history && -z $HISTFILE ]]; then
27- HISTFILE=$USER_ZDOTDIR /.zsh_history
28- fi
2934fi
3035
3136# Shell integration was disabled by the shell, exit without warning assuming either the shell has
You can’t perform that action at this time.
0 commit comments