@@ -100,27 +100,27 @@ end
100
100
101
101
# Preserve the user' s existing prompt, to wrap in our escape sequences.
102
102
function __preserve_fish_prompt --on-event fish_prompt
103
- if functions --query fish_prompt
104
- if functions --query __vsc_fish_prompt
105
- # Erase the fallback so it can be set to the user's prompt
106
- functions --erase __vsc_fish_prompt
107
- end
108
- functions --copy fish_prompt __vsc_fish_prompt
109
- functions --erase __preserve_fish_prompt
110
- # Now __vsc_fish_prompt is guaranteed to be defined
111
- __init_vscode_shell_integration
112
- else
113
- if functions --query __vsc_fish_prompt
114
- # There is no fish_prompt set, so stick with the default
115
- functions --erase __preserve_fish_prompt
116
- # Now __vsc_fish_prompt is guaranteed to be defined
117
- __init_vscode_shell_integration
118
- else
119
- function __vsc_fish_prompt
120
- echo -n (whoami)@(prompt_hostname) (prompt_pwd ) ' ~> '
121
- end
122
- end
123
- end
103
+ if functions --query fish_prompt
104
+ if functions --query __vsc_fish_prompt
105
+ # Erase the fallback so it can be set to the user's prompt
106
+ functions --erase __vsc_fish_prompt
107
+ end
108
+ functions --copy fish_prompt __vsc_fish_prompt
109
+ functions --erase __preserve_fish_prompt
110
+ # Now __vsc_fish_prompt is guaranteed to be defined
111
+ __init_vscode_shell_integration
112
+ else
113
+ if functions --query __vsc_fish_prompt
114
+ # There is no fish_prompt set, so stick with the default
115
+ functions --erase __preserve_fish_prompt
116
+ # Now __vsc_fish_prompt is guaranteed to be defined
117
+ __init_vscode_shell_integration
118
+ else
119
+ function __vsc_fish_prompt
120
+ echo -n (whoami)@(prompt_hostname) (prompt_pwd ) ' ~> '
121
+ end
122
+ end
123
+ end
124
124
end
125
125
__preserve_fish_prompt
126
126
@@ -158,24 +158,24 @@ end
158
158
# prompt), but only if it's not defined as an empty function (which is the
159
159
# officially documented way to disable that feature).
160
160
function __init_vscode_shell_integration
161
- if __vsc_fish_has_mode_prompt
162
- functions --copy fish_mode_prompt __vsc_fish_mode_prompt
163
-
164
- function fish_mode_prompt
165
- __vsc_fish_prompt_start
166
- __vsc_fish_mode_prompt
167
- end
168
-
169
- function fish_prompt
170
- __vsc_fish_prompt
171
- __vsc_fish_cmd_start
172
- end
173
- else
174
- # No fish_mode_prompt, so put everything in fish_prompt.
175
- function fish_prompt
176
- __vsc_fish_prompt_start
177
- __vsc_fish_prompt
178
- __vsc_fish_cmd_start
179
- end
180
- end
161
+ if __vsc_fish_has_mode_prompt
162
+ functions --copy fish_mode_prompt __vsc_fish_mode_prompt
163
+
164
+ function fish_mode_prompt
165
+ __vsc_fish_prompt_start
166
+ __vsc_fish_mode_prompt
167
+ end
168
+
169
+ function fish_prompt
170
+ __vsc_fish_prompt
171
+ __vsc_fish_cmd_start
172
+ end
173
+ else
174
+ # No fish_mode_prompt, so put everything in fish_prompt.
175
+ function fish_prompt
176
+ __vsc_fish_prompt_start
177
+ __vsc_fish_prompt
178
+ __vsc_fish_cmd_start
179
+ end
180
+ end
181
181
end
0 commit comments