%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/byobu/include/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/byobu/include/__pycache__/select-session.cpython-312.pyc

�

h��e���:�ddlZddlZddlZddlZ	ddlmZdZejdd�Z	ejd�Z
ejde
dz�Zejd	d
�ZdZ
gZgZej j#dez�Zgd
�Zd�Zd�Zd�Zd�Ze�Zej j#dez�Zee�dkDserJej5d�ej5dez�ej5d�ej5de	z�ee�dkDr�ej6j9d�dZedkr�dZeD]'Zej6j9deefz�edz
Z�)		ededz
z�Z e re dk(rdZ
nK	e!e �Z
e
dk\re
ekrn7edz
ZdZ
ejFj9d�	edkr��n
ee�dk(rdZ
e
dk\rkee
dz
dk(r2ed
k(rejLddde	g�nDejLdde	g�n.ee
dz
dk(rejLe	e	g�neee
dz
�ed
k(rejLd
d
g�yejLddd g�y#e$rY��hwxYw#e$rdZ Y��wxYw#e$re!e"e ��Z
Y��wxYw#e$$r1ej6j9d�ejJd�Y��e$r5e
dk(se
dk(rdZ
Y��edz
ZdZ
ejFj9d�Y��UwxYw)!�N)�input�byobu�SHELLz	/bin/bash�HOME�BYOBU_CONFIG_DIRz/.byobu�
BYOBU_BACKEND�tmux���z%s/.reuse-session)�DISPLAY�DBUS_SESSION_BUS_ADDRESS�SESSION_MANAGER�GPG_AGENT_INFO�XDG_SESSION_COOKIE�XDG_SESSION_PATH�GNOME_KEYRING_CONTROL�GNOME_KEYRING_PIDr�SSH_ASKPASS�
SSH_AUTH_SOCK�
SSH_AGENT_PID�WINDOWID�UPSTART_JOB�UPSTART_EVENTS�UPSTART_SESSION�UPSTART_INSTANCEc��g}d}d}tdk(�rf	tjddgtj��j	�d}tjj�|jd�}n)|jtjj�}|r�|j�D]�}tjdd	|�}|s�|d	k7s�#|jd	�dk(s�8t!|�dkDs�G|j#d
�dk(s�\|j#d�dk(s�qt$j'd|j)�z�|j+d	�}|j'd
|dz�|dz
}��tdk(�rtjddgtj��j	�d}tjj�|jd�}n)|jtjj�}|r�|j�D]}}|s�|j-d�r�|jd�dk(s�-t$j'd|j)�z�|j'd|j+d�dz�|dz
}�|S#tj
$r'}|jdk7r�|j}Yd}~���d}~wwxYw)NrF�screenz-ls��stdout��UTF-8z\s+� z..z._z
screen: %szscreen____%sr	�
list-sessions�_�-r
ztmux: %sz
tmux____%s�:)r�
subprocess�Popen�PIPE�communicate�CalledProcessError�
returncode�output�sysr�encoding�decode�
splitlines�re�sub�find�len�count�text�append�strip�split�
startswith)�sessions�ir,�cpe�s�itemss      �(/usr/lib/byobu/include/select-session.py�get_sessionsrA0sM������
���X������h��.�z���G�S�S�U�VW�X�6�	�Z�Z��� ��M�M�'�"�6��M�M�#�*�*�-�-�.�6�������q�
���v�s�A��A��Q�#�X�1�6�6�#�;�!�+��A���
�q�w�w�t�}�PQ�?Q�VW�V]�V]�^b�Vc�gh�Vh�	�[�[�����	�)�*�
�W�W�S�\�U�
�_�_�^�e�A�h�.�/��!�V�Q���V�����V�_�5�j�o�o�N�Z�Z�\�]^�_�&��Z�Z��� ��M�M�'�"�6��M�M�#�*�*�-�-�.�6�������q�����c�"�q�v�v�c�{�b�'8�	�[�[��a�g�g�i�'�(�
�_�_�\�A�G�G�C�L��O�3�4��!�V�Q��	���A
�	&�	&��	�n�n���	�
�Z�Z�F���s�8J"�"K�5K�Kc	�n�tdk(�r+tjddgtj��j	�d}t
jj�|jd�}n)|jt
jj�}|syd|z}tj||tj�}|syd|�d|jd	��d
�}tj||tj�D]-}tjddd|jd
�dg��/yy)Nr	r"rrr z^%s:.+\((group [^\)]+)\).*$z^_z	-\d+:.+\(rz\)$zkill-session�-tr%)rr&r'r(r)r-rr.r/r1�search�	MULTILINE�group�findallr9)�session_namer,�pattern�masterr>s     r@�cull_zombiesrKZs����V�����V�_�5�j�o�o�N�Z�Z�\�]^�_�&��Z�Z��� ��M�M�'�"�6��M�M�#�*�*�-�-�.�6�	�	�

-�|�;�'�
�9�9�W�f�b�l�l�3�&�	�	�
�(4�V�\�\�!�_�E�'�
�:�:�g�v�r�|�|�4�E�a�
���V�^�T�1�7�7�3�<��?�C�D�E�'�c��|jdd�\}}tD]`}tj|�}|s�|dk(r	ddd|||g}n	dd|dd||g}t	j
|t
tjd	��
��by)N�____�r	�setenvrCrz-Sz-X�wr)r9�BYOBU_UPDATE_ENVVARS�os�getenvr&�call�open�devnull)�session�backendrH�var�value�cmds      r@�update_environmentr]us}�� ���v�q�1���,� �6�S�
�)�)�C�.�%�
�
����8�T�<��e�
<�C��T�<��x��e�
D�C�
�?�?�3�t�B�J�J��4�5�6rLc��t|�|jdd�\}}t|�|dk(rAtrt	j
ddddd|g�yt	j
ddddd|dd	d
g�yt	j
ddd|g�y)
NrNrOr	z-u�attachrC�new-session�;z
set-optionzdestroy-unattachedr�-AOxRR)r]r9rK�reuse_sessionsrS�execvp)rXrYrHs   r@�attach_sessionre�s����G�� ���v�q�1���,�
�l���v����9�9�V�f�d�H�d�L�A�B��9�9�V�f�d�M�4��s�L�Zn�o�p��)�)�H�x��<�8�9rLz%s/.always-selectr�NEWzCreate a new Byobu session (%s)zRun a shell without Byobu (%s)z
Byobu sessions...

�z	  %d. %s
z
Choose 1-%d [1]: �z
ERROR: Invalid input
�
r`rrb)'rSr1r-r&�builtinsr�	Exception�PKGrTrrrr�choicer;r6�path�existsrcrRrArKr]re�
show_shellr4r7r�write�triesr<r>�
user_input�int�eval�stderr�KeyboardInterrupt�exitrd�rLr@�<module>rzs��.
�	�
��������	�	�'�;�'���r�y�y�����2�9�9�/��	�1A�B����	�	�/�6�2�
�	��
��	������� 3�7G� H�I��S��'�TE�6	6�:��>��
�W�W�^�^�/�3C�D�
E�
��x�=�1��
�	��������
.��
>�?�	��������
-��
5�6��x�=�1�������+�,�	
���q�y��!��
�a��:�:���L�A�q�6�)�*���6�1�
�0���,��A��6�7�J��
�b�(�
�F�	�#�
��_�F�
��k�f�q�j�	�	�Q�J�E�
�F��J�J���/�0�-
�q�y�B	��]�a��
��	�Q�;��V�a�Z��E�!��f���2�9�9�W�w�
�u�5�6��2�9�9�W�w��&�'��v��z��g�%��"�)�)�E�E�7����&�1�*�%�&��F��
����6�F�8��
����8�h��)�*��g�����J���J����#�
��j�!�
"�F�#��
���:�:���D���3�8�8�A�;�	�0���l�f��l�
�F�	��A�:�5��6��:�:���.�/�
0�sw�I8�5J�	J,�J�
J,�!"J,�8J�J�J�J,�J�J,�J)�%J,�(J)�)J,�,2L�!L�4"L�L

Zerion Mini Shell 1.0