ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / contrib / terminal / common / scripts / shellIntegration-bash.sh 493 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
if [ [ -n "${VSCODE_SHELL_INTEGRATION:- } " ] ] ; then
builtin return
fi
VSCODE_SHELL_INTEGRATION = 1
vsc_env_keys = ( )
vsc_env_values = ( )
use_associative_array = 0
bash_major_version = ${BASH_VERSINFO [ 0] }
__vscode_shell_env_reporting = "${VSCODE_SHELL_ENV_REPORTING:- } "
unset VSCODE_SHELL_ENV_REPORTING
envVarsToReport =
envVarsToReport
vsc_aa_env
~/.bashrc
~/.bashrc
/etc/profile
/etc/profile
~/.bash_profile
~/.bash_profile
~/.bash_login
~/.bash_login
~/.profile
~/.profile
VSCODE_SHELL_LOGIN
VSCODE_PATH_PREFIX
VSCODE_INJECTION
VSCODE_PREVENT_SHELL_HISTORY
ADDR
VSCODE_ENV_REPLACE
ADDR
VSCODE_ENV_PREPEND
ADDR
VSCODE_ENV_APPEND
VSCODE_PYTHON_*_ACTIVATE
terms
C out
__vsc_escape_value_fast
C
i
val
byte
token
val
token
__vsc_regex_environment
__vsc_regex_histcontrol
VSCODE_NONCE
VSCODE_STABLE
vsc_aa_env
vsc_env_values
vsc_aa_env
__updateEnvCacheAA
__updateEnvCache
__vsc_update_cwd
__vsc_update_cwd
__vsc_command_complete
__vsc_report_prompt
__vsc_update_prompt
__vsc_update_env
__vsc_prompt*
__vsc_command_output_start
__vsc_preexec
__vsc_prompt_cmd
__vsc_preexec_only
__vsc_preexec
DEBUG
__vsc_preexec
DEBUG
__vsc_update_prompt
cmd
__vsc_restore_exit_code
__vsc_precmd
__vsc_precmd
__vsc_prompt_cmd_original
__vsc_prompt_cmd
(
)
IFS
=
','
read
-ra
<<<
"$__vscode_shell_env_reporting "
if
(( BASH_VERSINFO[0 ] >= 4 ))
;
then
use_associative_array
=
1
declare
-A
fi
if
[
"$VSCODE_INJECTION "
==
"1"
]
;
then
if
[
-z
"$VSCODE_SHELL_LOGIN "
]
;
then
if
[
-r
]
;
then
.
fi
else
if
[
-r
]
;
then
.
fi
if
[
-r
]
;
then
.
elif
[
-r
]
;
then
.
elif
[
-r
]
;
then
.
fi
builtin
unset
if
[
-n
"${VSCODE_PATH_PREFIX:- } "
]
;
then
export
PATH
=
"$VSCODE_PATH_PREFIX $PATH "
builtin
unset
fi
fi
builtin
unset
fi
if
[
-z
"$VSCODE_SHELL_INTEGRATION "
]
;
then
builtin
return
fi
if
[
"${VSCODE_PREVENT_SHELL_HISTORY:- } "
=
"1"
]
;
then
export
HISTCONTROL
=
"ignorespace"
builtin
unset
fi
if
[
-n
"${VSCODE_ENV_REPLACE:- } "
]
;
then
IFS
=
':'
read
-ra
<<<
"$VSCODE_ENV_REPLACE "
for
ITEM
in
"${ADDR[ @] } "
;
do
VARNAME
=
"$( echo $ITEM | cut -d "=" -f 1 ) "
VALUE
=
"$( echo -e "$ITEM " | cut -d "=" -f 2 -) "
export
$VARNAME
=
"$VALUE "
done
builtin
unset
fi
if
[
-n
"${VSCODE_ENV_PREPEND:- } "
]
;
then
IFS
=
':'
read
-ra
<<<
"$VSCODE_ENV_PREPEND "
for
ITEM
in
"${ADDR[ @] } "
;
do
VARNAME
=
"$( echo $ITEM | cut -d "=" -f 1 ) "
VALUE
=
"$( echo -e "$ITEM " | cut -d "=" -f 2 -) "
export
$VARNAME
=
"$VALUE ${! VARNAME} "
done
builtin
unset
fi
if
[
-n
"${VSCODE_ENV_APPEND:- } "
]
;
then
IFS
=
':'
read
-ra
<<<
"$VSCODE_ENV_APPEND "
for
ITEM
in
"${ADDR[ @] } "
;
do
VARNAME
=
"$( echo $ITEM | cut -d "=" -f 1 ) "
VALUE
=
"$( echo -e "$ITEM " | cut -d "=" -f 2 -) "
export
$VARNAME
=
"${! VARNAME} $VALUE "
done
builtin
unset
fi
if
[
-z
"${VSCODE_PYTHON_AUTOACTIVATE_GUARD:- } "
]
;
then
export
VSCODE_PYTHON_AUTOACTIVATE_GUARD
=
1
if
[
-n
"${VSCODE_PYTHON_BASH_ACTIVATE:- } "
]
&&
[
"$TERM_PROGRAM "
=
"vscode"
]
;
then
if
!
builtin
eval
"$VSCODE_PYTHON_BASH_ACTIVATE "
;
then
__vsc_activation_status
=
$?
builtin
printf
'\x1b[0m\x1b[7m * \x1b[0;103m VS Code Python bash activation failed with exit code %d \x1b[0m'
"$__vsc_activation_status "
fi
fi
for
var
in
"${! VSCODE_PYTHON_@} "
;
do
case
"$var "
in
)
unset
"$var "
;
;
esac
done
fi
__vsc_get_trap
(
)
{
builtin
local
-a
builtin
eval
"terms=( $( trap -p "${1:- DEBUG} " ) )"
builtin
printf
'%s'
"${terms[ 2] :- } "
}
__vsc_escape_value_fast
(
)
{
builtin
local
LC_ALL
=
out
=
${1/ / \\/ \\\\}
out
=
${out/ / ;/ \\x3b}
builtin
printf
'%s\n'
"${out} "
}
__vsc_escape_value
(
)
{
if
[
"${# 1} "
-ge
2000
]
;
then
"$1 "
builtin
return
fi
builtin
local
-r
LC_ALL
=
builtin
local
-r
str
=
"${1} "
builtin
local
-ir
len
=
"${# str} "
builtin
local
-i
builtin
local
-i
builtin
local
builtin
local
builtin
local
out
=
''
for
(( i= 0 ; i < "${#str}"; ++ i ))
;
do
byte
=
"${str: $i: 1} "
builtin
printf
-v
'%d'
"'$byte "
if
(( val < 31 ))
;
then
builtin
printf
-v
'\\x%02x'
"'$byte "
elif
(( val == 92 ))
;
then
token
=
"\\ \\ "
elif
(( val == 59 ))
;
then
token
=
"\\ x3b"
else
token
=
"$byte "
fi
out
+=
"$token "
done
builtin
printf
'%s\n'
"$out "
}
__vsc_regex_environment
=
"^CYGWIN*|MINGW*|MSYS*"
if
[
[
"$( uname -s ) "
=~
$__vsc_regex_environment
]
]
;
then
builtin
printf
'\e]633;P;IsWindows=True\a'
__vsc_is_windows
=
1
else
__vsc_is_windows
=
0
fi
__vsc_regex_histcontrol
=
".*(erasedups|ignoreboth|ignoredups|ignorespace).*"
if
[
[
"${HISTCONTROL :- } "
=~
$__vsc_regex_histcontrol
]
]
;
then
__vsc_history_verify
=
0
else
__vsc_history_verify
=
1
fi
builtin
unset
builtin
unset
__vsc_initialized
=
0
__vsc_original_PS1
=
"$PS1 "
__vsc_original_PS2
=
"$PS2 "
__vsc_custom_PS1
=
""
__vsc_custom_PS2
=
""
__vsc_in_command_execution
=
"1"
__vsc_current_command
=
""
__vsc_nonce
=
"$VSCODE_NONCE "
unset
__vsc_stable
=
"$VSCODE_STABLE "
unset
if
[
"$__vsc_stable "
=
"0"
]
;
then
builtin
printf
"\e ]633;P;ContinuationPrompt=$( echo "$PS2 " | sed 's/\x1b/\\\\x1b/g' ) \a "
fi
if
[
-n
"$STARSHIP_SESSION_KEY "
]
;
then
builtin
printf
'\e]633;P;PromptType=starship\a'
elif
[
-n
"$POSH_SESSION_ID "
]
;
then
builtin
printf
'\e]633;P;PromptType=oh-my-posh\a'
fi
builtin
printf
'\e]633;P;HasRichCommandDetection=True\a'
__vsc_report_prompt
(
)
{
if
(( BASH_VERSINFO[0 ] >= 5 || ( BASH_VERSINFO[0 ] == 4 && BASH_VERSINFO[1 ] >= 4 ))
)
;
then
__vsc_prompt
=
${__vsc_original_PS1@P}
else
__vsc_prompt
=
${__vsc_original_PS1}
fi
__vsc_prompt
=
"$( builtin printf "%s" "${__vsc_prompt/ / [ $'\001'$'\002'] } " ) "
builtin
printf
"\e ]633;P;Prompt=%s\a "
"$( __vsc_escape_value "${__vsc_prompt} " ) "
}
__vsc_prompt_start
(
)
{
builtin
printf
'\e]633;A\a'
}
__vsc_prompt_end
(
)
{
builtin
printf
'\e]633;B\a'
}
__vsc_update_cwd
(
)
{
if
[
"$__vsc_is_windows "
=
"1"
]
;
then
__vsc_cwd
=
"$( cygpath -m "$PWD " ) "
else
__vsc_cwd
=
"$PWD "
fi
builtin
printf
'\e]633;P;Cwd=%s\a'
"$( __vsc_escape_value "$__vsc_cwd " ) "
}
__updateEnvCacheAA
(
)
{
local
key
=
"$1 "
local
value
=
"$2 "
if
[
"$use_associative_array "
=
1
]
;
then
if
[
[
"${vsc_aa_env[ $key] } "
!=
"$value "
]
]
;
then
[
"$key "
]
=
"$value "
builtin
printf
'\e]633;EnvSingleEntry;%s;%s;%s\a'
"$key "
"$( __vsc_escape_value "$value " ) "
"$__vsc_nonce "
fi
fi
}
__updateEnvCache
(
)
{
local
key
=
"$1 "
local
value
=
"$2 "
for
i
in
"${! vsc_env_keys[ @] } "
;
do
if
[
[
"${vsc_env_keys[ $i] } "
==
"$key "
]
]
;
then
if
[
[
"${vsc_env_values[ $i] } "
!=
"$value "
]
]
;
then
[
$i
]
=
"$value "
builtin
printf
'\e]633;EnvSingleEntry;%s;%s;%s\a'
"$key "
"$( __vsc_escape_value "$value " ) "
"$__vsc_nonce "
fi
return
fi
done
vsc_env_keys
+=
(
"$key "
)
vsc_env_values
+=
(
"$value "
)
builtin
printf
'\e]633;EnvSingleEntry;%s;%s;%s\a'
"$key "
"$( __vsc_escape_value "$value " ) "
"$__vsc_nonce "
}
__vsc_update_env
(
)
{
if
[
[
${# envVarsToReport[ @] }
-gt
0
]
]
;
then
builtin
printf
'\e]633;EnvSingleStart;%s;%s\a'
0
$__vsc_nonce
if
[
"$use_associative_array "
=
1
]
;
then
if
[
${# vsc_aa_env[ @] }
-eq
0
]
;
then
for
key
in
"${envVarsToReport[ @] } "
;
do
if
[
-n
"${! key+x} "
]
;
then
local
value
=
"${! key} "
[
"$key "
]
=
"$value "
builtin
printf
'\e]633;EnvSingleEntry;%s;%s;%s\a'
"$key "
"$( __vsc_escape_value "$value " ) "
"$__vsc_nonce "
fi
done
else
for
key
in
"${envVarsToReport[ @] } "
;
do
if
[
-n
"${! key+x} "
]
;
then
local
value
=
"${! key} "
"$key "
"$value "
fi
done
fi
else
if
[
[
-z
${vsc_env_keys[ @] }
]
]
&&
[
[
-z
${vsc_env_values[ @] }
]
]
;
then
for
key
in
"${envVarsToReport[ @] } "
;
do
if
[
-n
"${! key+x} "
]
;
then
local
value
=
"${! key} "
vsc_env_keys
+=
(
"$key "
)
vsc_env_values
+=
(
"$value "
)
builtin
printf
'\e]633;EnvSingleEntry;%s;%s;%s\a'
"$key "
"$( __vsc_escape_value "$value " ) "
"$__vsc_nonce "
fi
done
else
for
key
in
"${envVarsToReport[ @] } "
;
do
if
[
-n
"${! key+x} "
]
;
then
local
value
=
"${! key} "
"$key "
"$value "
fi
done
fi
fi
builtin
printf
'\e]633;EnvSingleEnd;%s;\a'
$__vsc_nonce
fi
}
__vsc_command_output_start
(
)
{
if
[
[
-z
"${__vsc_first_prompt-} "
]
]
;
then
builtin
return
fi
builtin
printf
'\e]633;E;%s;%s\a'
"$( __vsc_escape_value "${__vsc_current_command} " ) "
$__vsc_nonce
builtin
printf
'\e]633;C\a'
}
__vsc_continuation_start
(
)
{
builtin
printf
'\e]633;F\a'
}
__vsc_continuation_end
(
)
{
builtin
printf
'\e]633;G\a'
}
__vsc_command_complete
(
)
{
if
[
[
-z
"${__vsc_first_prompt-} "
]
]
;
then
builtin
return
fi
if
[
"$__vsc_current_command "
=
""
]
;
then
builtin
printf
'\e]633;D\a'
else
builtin
printf
'\e]633;D;%s\a'
"$__vsc_status "
fi
}
__vsc_update_prompt
(
)
{
if
[
"$__vsc_in_command_execution "
=
"1"
]
;
then
if
[
[
"$__vsc_custom_PS1 "
==
""
||
"$__vsc_custom_PS1 "
!=
"$PS1 "
]
]
;
then
__vsc_original_PS1
=
$PS1
__vsc_custom_PS1
=
"\[$( __vsc_prompt_start) \]$__vsc_original_PS1 \[$( __vsc_prompt_end) \]"
PS1
=
"$__vsc_custom_PS1 "
fi
if
[
[
"$__vsc_custom_PS2 "
==
""
||
"$__vsc_custom_PS2 "
!=
"$PS2 "
]
]
;
then
__vsc_original_PS2
=
$PS2
__vsc_custom_PS2
=
"\[$( __vsc_continuation_start) \]$__vsc_original_PS2 \[$( __vsc_continuation_end) \]"
PS2
=
"$__vsc_custom_PS2 "
fi
__vsc_in_command_execution
=
"0"
fi
}
__vsc_precmd
(
)
{
"$__vsc_status "
__vsc_current_command
=
""
if
[
"$__vsc_stable "
=
"0"
]
;
then
fi
__vsc_first_prompt
=
1
}
__vsc_preexec
(
)
{
__vsc_initialized
=
1
if
[
[
!
$BASH_COMMAND
==
]
]
;
then
if
[
"$__vsc_history_verify "
=
"1"
]
;
then
__vsc_current_command
=
"$( builtin history 1 | sed 's/ *[0-9]* *//' ) "
else
__vsc_current_command
=
$BASH_COMMAND
fi
else
__vsc_current_command
=
""
fi
}
if
[
[
-n
"${bash_preexec_imported:- } "
]
]
;
then
__vsc_preexec_only
(
)
{
if
[
"$__vsc_in_command_execution "
=
"0"
]
;
then
__vsc_in_command_execution
=
"1"
fi
}
precmd_functions
+=
(
)
preexec_functions
+=
(
)
else
__vsc_dbg_trap
=
"$( __vsc_get_trap DEBUG) "
if
[
[
-z
"$__vsc_dbg_trap "
]
]
;
then
__vsc_preexec_only
(
)
{
if
[
"$__vsc_in_command_execution "
=
"0"
]
;
then
__vsc_in_command_execution
=
"1"
fi
}
trap
'__vsc_preexec_only "$_"'
elif
[
[
"$__vsc_dbg_trap "
!=
'__vsc_preexec "$_"'
&&
"$__vsc_dbg_trap "
!=
'__vsc_preexec_all "$_"'
]
]
;
then
__vsc_preexec_all
(
)
{
if
[
"$__vsc_in_command_execution "
=
"0"
]
;
then
__vsc_in_command_execution
=
"1"
builtin
eval
"${__vsc_dbg_trap} "
fi
}
trap
'__vsc_preexec_all "$_"'
fi
fi
__vsc_restore_exit_code
(
)
{
return
"$1 "
}
__vsc_prompt_cmd_original
(
)
{
__vsc_status
=
"$? "
builtin
local
"${__vsc_status} "
for
cmd
in
"${__vsc_original_prompt_command[ @] } "
;
do
eval
"${cmd:- } "
done
}
__vsc_prompt_cmd
(
)
{
__vsc_status
=
"$? "
}
__vsc_original_prompt_command
=
${PROMPT_COMMAND:- }
if
[
[
-z
"${bash_preexec_imported:- } "
]
]
;
then
if
[
[
-n
"${__vsc_original_prompt_command:- } "
&&
"${__vsc_original_prompt_command:- } "
!=
"__vsc_prompt_cmd"
]
]
;
then
PROMPT_COMMAND
=
else
PROMPT_COMMAND
=
fi
fi