Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/externalTerminal/node/TerminalHelper.scpt
3296 views
FasdUAS 1.101.10����
k
l����C=-------------------------------------------------------------�		z-------------------------------------------------------------


l��
��@: Copyright (C) Microsoft Corporation. All rights reserved.
�t Copyright (C) Microsoft Corporation. All rights reserved.
l����C=-------------------------------------------------------------�z-------------------------------------------------------------
l������������
l����e_ the following two properties are persisted across different runs of this TerminalHelper script�� the following two properties are persisted across different runs of this TerminalHelper script
l����B< they are used to reuse the same terminal across invocations�x they are used to reuse the same terminal across invocations !
 j��"��0lastttylastTty
"m��
��
msng!#$
#j��%��0lastwindowidlastWindowID
%m��
��
msng$&'
&l������������'()
(i	*+
*I��,��
��.aevtoappnull��****
,o����0argv��
+k�--./
.l������������/01
0r23
2m��
��
msng
3o����0window_title145
4r67
6m��
��
msng
7o����0working_dir589
8r:;
:m	<<�==
;o����0programargsprogramArgs9>?
>r@A
@m
BB�CC
Ao����0env_vars?DE
Dl������������EFG
FY�H��IJ��
Hk�KKLM
Lr$NO
Nl"P����
Pn"QR
Q4"��S
��
cobj
So !����0i
Ro����0argv����
Oo����0aMTU
Tl%%������������UVW
VZ%�XYZ��
X=%([\
[o%&����0a
\m&']]�^^-w
Yk+9__`a
`r+0bc
b[+.de
do+,����0i
em,-����
co����0iaf��
fr19gh
gn17ij
i157��
��
strq
jl15k����
kn15lm
l425��n
��
cobj
no34����0i
mo12����0argv����
ho����0working_dir��Zop
o=<?qr
qo<=����0a
rm=>ss�tt-apuv
ukBTwwxy
xrBGz{
z[BE|}
|oBC����0i
}mCD����
{o����0iy~��
~rHT�
bHR��
�bHK��
�oHI����0programargsprogramArgs
�mIJ����� 
�nKQ��
�1OQ��
��
strq
�lKO�����
�nKO��
�4LO���
��
cobj
�oMN����0i
�oKL����0argv����
�o����0programargsprogramArgs��v��
�=WZ��
�oWX����0a
�mXY�����-e���
�k]o����
�r]b��
�[]`��
�o]^����0i
�m^_����
�o����0i����
�rco��
�bcm��
�bcf��
�ocd����0env_vars
�mde����� 
�nfl��
�1jl��
��
strq
�lfj�����
�nfj��
�4gj���
��
cobj
�ohi����0i
�ofg����0argv����
�o����0env_vars�����
�=rw��
�ors����0a
�msv�����-u���
�kz�����
�rz��
�[z}��
�oz{����0i
�m{|����
�o����0i����
�r����
�b����
�b����
�o������0env_vars
�m������� -u 
�n����
�1����
��
strq
�l�������
�n����
�4�����
��
cobj
�o������0i
�o������0argv����
�o����0env_vars�����
�=����
�o������0a
�m�������-t����
�k������
�r����
�[����
�o������0i
�m������
�o����0i����
�r����
�l�������
�n����
�4�����
��
cobj
�o������0i
�o������0argv����
�o����0window_title������W���
�l������������������0i
Im����
Jl�����
�I�����
��.corecnte********
�o����0argv��������G��
�l�����������������
�r����
�m������� 
�o����0cmd���
�Z��������
�>����
�o������0working_dir
�m����
��
msng
�r����
�b����
�b����
�b����
�o������0cmd
�m�������cd 
�o������0working_dir
�m�������; 
�o����0cmd�������
�l������~����~���
�Z����}�|
�>��
o���{�{0env_vars
m���
r��
b��
b��	

	o���z�z0cmd

m���env
o���y�y0env_vars
o�x�x0cmd�}�|�


l���w�v�u�w�v�u
Z��t�s
>��
o���r�r0programargsprogramArgs
m���
r�
b��
o���q�q0cmd
o���p�p0programargsprogramArgs
o�o�o0cmd�t�s
l�n�m�l�n�m�l
O� 
k�!!"#
"l�k�j�i�k�j�i#$%
$r&'
&n()
(I�h*�g�h&0findnonbusyttytabfindNonBusyTtyTab*+,
+o�f�f0lastwindowidlastWindowID,-�e
-o�d�d0lastttylastTty�e�g
)f
'o�c�c0	targettab	targetTab%./
.l�b�a�`�b�a�`/01
0Z�23�_4
2>&56
5o"�^�^0	targettab	targetTab
6m"%�]
�]
null
3k)@7789
8l))�\:;�\: reuse terminal;�<< reuse terminal9=>
=l)2?@A
?r)2BC
Bm)*�[
�[boovtrue
CnDE
D1-1�Z
�Z
tbsl
Eo*-�Y�Y0	targettab	targetTab@ bring tab to frontA�FF& bring tab to front>G�X
GI3@�WHI
�W.coredoscnull������ctxt
Ho36�V�V0cmdI�UJ�T
�U
kfil
Jo9<�S�S0	targettab	targetTab�T�X�_
4kC�KKLM
LlCC�RNO�RN create new terminalO�PP( create new terminalMQR
QlCC�Q�P�O�Q�P�ORST
SlCNUVW
UrCNXY
XlCJZ�N�M
ZICJ�L[�K
�L.coredoscnull������ctxt
[mCF\\�]]�K�N�M
Yo�J�J0	targettab	targetTabV1+ the empty script "" creates a new terminalW�^^V the empty script "" creates a new terminalT_`
_lOTabc
aIOT�Id�H
�I.sysodelanull������nmbr
dmOP�G�G�Hb^X insert a 1 second delay so that the newly created terminal gets more time to initializec�ee� insert a 1 second delay so that the newly created terminal gets more time to initialize`fg
flUU�F�E�D�F�E�Dghi
hlUbjkl
jIUb�Cmn
�C.coredoscnull������ctxt
moUX�B�B0cmdn�Ao�@
�A
kfil
oo[^�?�?0	targettab	targetTab�@k*$ execute the command in the terminall�ppH execute the command in the terminaliqr
qlcc�>�=�<�>�=�<rst
slcc�;uv�;u.( remember tty and window ID for next runv�wwP remember tty and window ID for next runtxy
xrcpz{
zlcj|�:�9
|ncj}~
}1fj�8
�8
ttty
~ocf�7�70	targettab	targetTab�:�9
{o�6�60lastttylastTtyy�
rq��
�nq{��
�Ir{�5��4�50
window_of_tab���3
�orw�2�20lastttylastTty�3�4
�fqr
�o�1�10	thewindow	theWindow���
�Z�����0�/
�>����
�o���.�.0	thewindow	theWindow
�m���-
�-
null
�r����
�n����
�1���,
�,
ID  
�n����
�I���+��*�+0
window_of_tab���)
�o���(�(0lastttylastTty�)�*
�f��
�o�'�'0lastwindowidlastWindowID�0�/���
�l���&�%�$�&�%�$���#
�Z�����"�!
�>����
�o��� � 0window_title
�m���
�
msng
�k������
�r����
�m���
�boovtrue
�n��
�1���
�
tdct
�o����0	targettab	targetTab���
�r����
�m���
�boovfals
�n��
�1���
�
tdsp
�o����0	targettab	targetTab���
�l�������:4set title displays device name of targetTab to false����hset title displays device name of targetTab to false���
�r����
�o����0window_title
�n��
�1���
�
titl
�o����0	targettab	targetTab��"�!�#1��
�l���������
 m���@alis6HDBD����Terminal.app��������
 cu	Utilities-/:System:Applications:Utilities:Terminal.app/Terminal.appHD*System/Applications/Utilities/Terminal.app/����
�l�����
���
���
�L���
�m�������
�l���
�	��
�	��)��
�l���������
�i

��
�I����&0findnonbusyttytabfindNonBusyTtyTab���
�o��0awindowaWindow���
�o��0attyaTty��
�kb����
�O_��
�X^����
�kY����
�r��
�n��
�1��
��
ID  
�o����0
currentwindow
currentWindow
�o����0thewindowidtheWindowId����
�ZY������
�=��
�o����0thewindowidtheWindowId
�o����0awindowaWindow
�X"U����
�k4P����
�r49��
�n47��
�157��
��
ttty
�o45����0
currenttab
currentTab
�o����0thettytheTty����
�Z:P������
�F:G��
�l:=�����
�=:=��
�o:;����0thettytheTty
�o;<����0attyaTty����
�l@E�����
�>@E��
�n@C��
�1AC��
��
busy
�o@A����0
currenttab
currentTab
�mCD��
��boovtrue����
�LJL�
�oJK����0
currenttab
currentTab��������0
currenttab
currentTab
�n%(��
�2&(��
��
ttab
�o%&����0
currentwindow
currentWindow��������0
currentwindow
currentWindow
�2
��
��
cwin
�m���@alis6HDBD����Terminal.app��������
 cu	Utilities-/:System:Applications:Utilities:Terminal.app/Terminal.appHD*System/Applications/Utilities/Terminal.app/������
�L`b�
�m`a��
��
null�����
�l���������������
�i��
�I�������0
window_of_tab����
�o����0attyaTty����
�kH����
�OE�
�XD��
X?��
k(:
r(-	
n(+


1)+��
��
ttty
o()����0
currenttab
currentTab
	o����0thettytheTty��
Z.:
����

l.1����
=.1
o./����0thettytheTty
o/0����0attyaTty����
L46
o45����0
currentwindow
currentWindow��������0
currenttab
currentTab
n
2��
��
ttab
o����0
currentwindow
currentWindow��0
currentwindow
currentWindow
2
��
��
cwin
m�@alis6HDBD����Terminal.app��������
 cu	Utilities-/:System:Applications:Utilities:Terminal.app/Terminal.appHD*System/Applications/Utilities/Terminal.app/�����
LFH
mFG��
��
null���
l��������������
l����������������������������������0lastttylastTty��0lastwindowidlastWindowID
��.aevtoappnull��****��&0findnonbusyttytabfindNonBusyTtyTab��0
window_of_tab
��
msng
��
msng��+���� ��
��.aevtoappnull��****��0argv��������0argv��0i *������<��B��������]��s������������������������\����������������
��
msng��0window_title��0working_dir��0programargsprogramArgs��0env_vars
��.corecnte********
��
cobj��0a
��
strq��0cmd��&0findnonbusyttytabfindNonBusyTtyTab��0	targettab	targetTab
��
null
��
tbsl
��
kfil
��.coredoscnull������ctxt
��.sysodelanull������nmbr
��
ttty��0
window_of_tab��0	thewindow	theWindow
��
ID  
��
tdct
��
tdsp
��
titl����E�O�E�O�E�O�E�O�k�jkh��/E�O���kE�O��/�,E�Yo���kE�O��%��/�,%E�YT���kE�O��%��/�,%E�Y9�a�kE�O�a%��/�,%E�Y�a�kE�O��/E�YhOP[OY�mOaE`O��_a%�%a%E`YhO�a_a%�%E`YhO�a_�%E`YhOa�)bbl+E`O_ae_a,FO_a_l Y�a!j E`Okj"O_a_l O_a#,EcO)bk+$E`%O_%a)bk+$a&,EcYhO��"e_a',FOf_a(,FO�_a),FYhOPUOjOP�������!"����&0findnonbusyttytabfindNonBusyTtyTab����#��#������0awindowaWindow��0attyaTty��!��������������0awindowaWindow��0attyaTty��0
currentwindow
currentWindow��0thewindowidtheWindowId��0
currenttab
currentTab��0thettytheTty"���������������������
��
cwin
��
kocl
��
cobj
��.corecnte********
��
ID  
��
ttab
��
ttty
��
busy
��
bool
��
null��c�\Y*�-[��lkh��,E�O��82��-[��lkh��,E�O��		��,e�&�Yh[OY��Yh[OY��UO��������$%����0
window_of_tab���&�&�~�~0attyaTty��$�}�|�{�z�}0attyaTty�|0
currentwindow
currentWindow�{0
currenttab
currentTab�z0thettytheTty%�y�x�w�v�u�t�s
�y
cwin
�x
kocl
�w
cobj
�v.corecnte********
�u
ttab
�t
ttty
�s
null��I�B?*�-[��lkh(��-[��lkh��,E�O���Yh[OY��[OY��UO�ascr��ޭ