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 14
14
# as disable it by unsetting the variable.
15
15
VSCODE_SHELL_INTEGRATION=1
16
16
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
+
17
25
# Only fix up ZDOTDIR if shell integration was injected (not manually installed) and has not been called yet
18
26
if [[ " $VSCODE_INJECTION " == " 1" ]]; then
19
27
if [[ $options [norcs] = off && -f $USER_ZDOTDIR /.zshrc ]]; then
20
28
VSCODE_ZDOTDIR=$ZDOTDIR
21
29
ZDOTDIR=$USER_ZDOTDIR
30
+ # A user's custom HISTFILE location might be set when their .zshrc file is sourced below
22
31
. $USER_ZDOTDIR /.zshrc
23
32
ZDOTDIR=$VSCODE_ZDOTDIR
24
33
fi
25
-
26
- if [[ -f $USER_ZDOTDIR /.zsh_history && -z $HISTFILE ]]; then
27
- HISTFILE=$USER_ZDOTDIR /.zsh_history
28
- fi
29
34
fi
30
35
31
36
# 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