Admin Panel
����; � TeX output 2005.12.06:1546� ������� ���3*����鍑G�F��N� �j cmbx12�FGNU�ƧReadline�Library��G�0� �������� �G<�2K�`y
�3
cmr10�Edition��f5.1-b�M�eta1,�for��3��<x
�3
cmtt10�Readline�Library��V��eersion�5.1-b�eta1.��
��g�0No��!v�em�b�M�er��f2005����q��X��N� ff cmbx12�XChet�ffRamey���f,�Case�W�estern�Reserv���e�Univ�ersit�y�� �Brian�ffF���fo���x,�F�ree�Soft���w�are�ffF�oundation���̉ ������ *��� ���3*���� ��G�This���man��!ual�describ�M�es�the�GNU���Readline�Library�(v�ersion�5.1-b�M�eta1,��11�No�v�em�b�M�er�2005),��
33��Ga��library�whic��!h�aids�in�the�consistency�of�user�in�terface�across�discrete�programs�whic�h����Gpro��!vide��fa�command�line�in�terface.��33��GCop��!yrigh�t���������c��������f�;!",�
�3
cmsy10�
�����@�1988-2004��fF��eree�Soft��!w�are��fF�oundation,�Inc.����GP��!ermission�is�gran�ted�to�mak�e�and�distribute�v�erbatim�copies�of�this�man�ual�pro�vided�the��
33��Gcop��!yrigh�t��fnotice�and�this�p�M�ermission�notice�are�preserv��!ed�on�all�copies.����.��P��!ermission�:�is�gran�ted�to�cop�y��e,�_�distribute�and/or�mo�M�dify�this�do�cumen��!t�under����.��the���terms�of�the�GNU��JF��eree�Do�M�cumen��!tation�License,���V�ersion�1.1�or�an��!y�later����.��v��!ersion�I�published�b�y�the�F��eree�Soft�w�are�F��eoundation;�h�with�no�In�v��dDarian�t�Sections,����.��with���the�F��eron��!t-Co�v�er���texts�b�M�eing�\A���GNU�Man��!ual,"��and���with�the�Bac�k-Co�v�er����.��T��eexts��Was�in�(a)�b�M�elo��!w.���A��Gcop�y��Wof�the�license�is�included�in�the�section�en��!titled����.��\GNU��fF��eree�Do�M�cumen��!tation�License."����.��(a)��XThe�FSF's�Bac��!k-Co�v�er��XT��eext�is:���\Y�ou�ha��!v�e��Xfreedom�to�cop��!y�and�mo�M�dify����.��this��GNU��wMan��!ual,��Qlik�e�GNU��wsoft�w�are.��DCopies�published�b�y�the�F��eree�Soft�w�are����.��F��eoundation��fraise�funds�for�GNU�dev��!elopmen�t."��ff��GPublished��fb��!y�the�F��eree�Soft�w�are�F��eoundation����G59��fT��eemple�Place,�Suite�330,����GBoston,��fMA�02111-1307����GUSA��������� �� �����T�i�����3*�����֍��G�O��N� G� cmbx12�OT��aGable�z�of�Con��u�ten�ts���)33��G�X1�32Command�ffLine�Editing��j��32�YF
C� ff
cmbxti10�Y.�����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.��m��X1�����6G�1.1�
�5In��!tro�M�duction��fto�Line�Editing� \�� ��5� ':
�3
cmti10�.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
ތ�1��
33��6G1.2�
�5Readline��fIn��!teraction� �썑 ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ��1����ZG1.2.1�
�5Readline��fBare�Essen��!tials�&F�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
�w�1����ZG1.2.2�
�5Readline��fMo��!v�emen�t�Commands� ���� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ���2����ZG1.2.3�
�5Readline��fKilling�Commands����� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
w��2����ZG1.2.4�
�5Readline��fArgumen��!ts���� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
���3����ZG1.2.5�
�5Searc��!hing��ffor�Commands�in�the�History�(u�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
���3����6G1.3�
�5Readline��fInit�File�r��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��G��4����ZG1.3.1�
�5Readline��fInit�File�Syn��!tax� ���� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� }��4����ZG1.3.2�
�5Conditional��fInit�Constructs�#��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�����9����ZG1.3.3�
�5Sample��fInit�File����� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
p'�10����6G1.4�
�5Bindable��fReadline�Commands� �9�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� Xj�13����ZG1.4.1�
�5Commands��fF��eor�Mo��!ving�5؍� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� �13����ZG1.4.2�
�5Commands��fF��eor�Manipulating�The�History�3썑 ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.��
�13����ZG1.4.3�
�5Commands��fF��eor�Changing�T�ext����� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��c��14����ZG1.4.4�
�5Killing��fAnd�Y��eanking�⍑ ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ��16����ZG1.4.5�
�5Sp�M�ecifying��fNumeric�Argumen��!ts�`�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
ב�17����ZG1.4.6�
�5Letting��fReadline�T��!yp�M�e�F��eor�Y�ou�^ݍ� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
4
�17����ZG1.4.7�
�5Keyb�M�oard��fMacros�h ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� >�17����ZG1.4.8�
�5Some��fMiscellaneous�Commands� �1�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� qa�18����6G1.5�
�5Readline��fvi�Mo�M�de�9��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.����19��33��G�X2�32Programming�ffwith�GNU�Readline�����32�Y.�����32.����32.����32.����32.����32.����32.����32.����32.����X21����6G�2.1�
�5Basic��fBeha��!vior� �z�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ���21����6G2.2�
�5Custom��fF��eunctions� �� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ���22����ZG2.2.1�
�5Readline��fT��!yp�M�edefs�Hh�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
��22����ZG2.2.2�
�5W��eriting��fa�New�F�unction�jo�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ?��23����6G2.3�
�5Readline��fV��eariables�}x�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��R��24����6G2.4�
�5Readline��fCon��!v�enience�F��eunctions� �1�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� �a�28����ZG2.4.1�
�5Naming��fa�F��eunction��y�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
©�28����ZG2.4.2�
�5Selecting��fa�Keymap�{��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� P��28����ZG2.4.3�
�5Binding��fKeys�0"�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� R�29����ZG2.4.4�
�5Asso�M�ciating��fF��eunction�Names�and�Bindings� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.�� ���31����ZG2.4.5�
�5Allo��!wing��fUndoing�t1�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��Ib�31����ZG2.4.6�
�5Redispla��!y��捑 ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
_�32����ZG2.4.7�
�5Mo�M�difying��fT��eext� �Y�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� q��34����ZG2.4.8�
�5Character��fInput���� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
T��34����ZG2.4.9�
�5T��eerminal��fManagemen��!t����� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
���35����ZG2.4.10�
�5Utilit��!y��fF��eunctions��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
�B�35����ZG2.4.11�
�5Miscellaneous��fF��eunctions�r�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� T��36����ZG2.4.12�
�5Alternate��fIn��!terface��o�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��k��37����ZG2.4.13�
�5A��fReadline�Example�n�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� ��38�������� ���� ���G�ii�=�NGNU��fReadline�Library�����3*�����֍�6G2.5�
�5Readline��fSignal�Handling��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
���39��
33��6G2.6�
�5Custom��fCompleters�䍑 ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
��41����ZG2.6.1�
�5Ho��!w��fCompleting�W��eorks�_��� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
4��41����ZG2.6.2�
�5Completion��fF��eunctions� �`�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.�� _��42����ZG2.6.3�
�5Completion��fV��eariables��k�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��
���43����ZG2.6.4�
�5A��fShort�Completion�Example�$K�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���|�47��33���G�XApp�s3endix�ffA��t�rCop���ying�ffThis�Man�ual�J���32�Y.�����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.��6�X57�����6G�A.1�
�5GNU��fF��eree�Do�M�cumen��!tation�License�=�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��B�57����ZGA.1.1�
�5ADDENDUM:��fHo��!w�to�use�this�License�for�y�our����o��do�M�cumen��!ts�^|�� ��.��.ԍ� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.���� �.��3��63����G�XConcept�ffIndex�H~��32�Y.�����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.��3��X65�� ���GF���function�ffand�V�ariable�Index� �.��32�Y.�����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.����32.��
ͤ�X67���� 4���� ���G�Chapter��f1:���Command�Line�Editing�MH1�����3*�����֍��G�O1� �QCommand�z�Line�Editing����=��!G�This��fc��!hapter�describ�M�es�the�basic�features�of�the��8�-�
�3
cmcsc10�gnu��command�line�editing�in�terface.��h����G�X1.1��In���tro�s3duction�f@to�Line�Editing���ޛ��!G�The��ffollo��!wing�paragraphs�describ�M�e�the�notation�used�to�represen�t�k�eystrok�es.���h��!GThe�Ctext��9��<x
�3
cmsltt10�C-k��is�read�as�`Con��!trol-K'�+and�describ�M�es�the�c�haracter�pro�M�duced�when�the�������
���� cmsy9�h�������@ � ff |v�� ��|{Y cmr8�k�����ٚ� ff |v���
������i����
33��G�k��!ey��fis�pressed�while�the�Con�trol�k�ey�is�depressed.����!GThe��ztext��M-k��is�read�as�`Meta-K'��oand�describ�M�es�the�c��!haracter�pro�duced�when�the�Meta����Gk��!ey�i/(if�y�ou�ha�v�e�one)�is�depressed,�umand�the�������h����S���@ � ff |v�� ��k���S��ٚ� ff |v���
M㞙��i���O��k�ey�is�pressed.��uThe�Meta�k�ey�is�lab�M�eled�������h����S���@ � ff �� ��AL��J�T���S��ٚ� ff ���샞���i������G�on�%�man��!y�k�eyb�M�oards.���On�k�eyb�M�oards�with�t�w�o�k�eys�lab�M�eled�������h�������@ � ff �� ��AL��J�T�����ٚ� ff ��������i���g��(usually�to�either�side�of�the����Gspace���bar),�̛the�������h�����ß�@ � ff �� ��AL��J�T����ßٚ� ff ���HK����i����$�on�the�left�side�is�generally�set�to�w��!ork�as�a�Meta�k�ey��e.�9�The�������h�����ß�@ � ff �� ��AL��J�T����ßٚ� ff ���HK����i����$�k�ey����Gon��the�righ��!t�ma�y�also�b�M�e�congured�to�w�ork�as�a�Meta�k�ey�or�ma�y�b�M�e�congured�as�some����Gother��fmo�M�dier,�suc��!h�as�a�Comp�ose�k��!ey�for�t�yping�accen�ted�c�haracters.����!GIf��ly��!ou�do�not�ha�v�e�a�Meta�or�������h�����8��@ � ff �� ��AL��J�T����8�ٚ� ff ��� �����i���W�k�ey��e,��kor�another�k�ey�w�orking�as�a�Meta�k�ey��e,��kthe�iden�tical����Gk��!eystrok�e��1can�b�M�e�generated�b��!y�t�yping�������h��������@ � ff �T�� ��ESC������ٚ� ff �T����Þ���i�����rst�,���and�then�t�yping�������h��������@ � ff |v�� ��k������ٚ� ff |v��� �垙��i���
0��.���Either�pro�M�cess�is�kno�wn����Gas��f�6p�0J
�3
cmsl10�metafying��~�the�������h�����2��@ � ff |v�� ��k����2�ٚ� ff |v���
�����i����b�k��!ey��e.����!GThe���text��M-C-k��is�read�as�`Meta-Con��!trol-k'�and�describ�M�es�the�c�haracter�pro�M�duced�b�y����G�metafying��~�C-k�.����!GIn�oaddition,��,sev��!eral�k�eys�ha�v�e�their�o�wn�names.�7�Sp�M�ecically��e,����,����h��������@ � ff ���� ��DEL������ٚ� ff ������d����i���6F�,����,����h��������@ � ff �T�� ��ESC������ٚ� ff �T���������i���F��,����,����h��������@ � ff W��� ��LFD������ٚ� ff W����`�i������,����,����h��������@ � ff �T�� ��SPC������ٚ� ff �T���������i����,������G����h�������@ � ff ,(�� ��RET�����ٚ� ff ,(���&������i���*>��,��9and���8�����h����#u��@ � ff �l�� ��T��J�AB���#u�ٚ� ff �l���qS����i���"B��all�8�stand�for�themselv��!es�when�seen�in�this�text,�or�in�an�init�le�(see����GSection���1.3�[Readline�Init�File],��"page�4).�ߡIf�y��!our�k�eyb�M�oard�lac�ks�a�������h�����ɟ�@ � ff W��� ��LFD����ɟٚ� ff W����fÞ���i��� ���k�ey��e,��"t�yping�������h�����ɟ�@ � ff �ҟ� ��C-j����ɟٚ� ff �Ҏ���
����i������G�will��Opro�M�duce�the�desired�c��!haracter.���The�������h����v��@ � ff ,(�� ��RET���v�ٚ� ff ,(��������i���C��k�ey�ma�y�b�M�e�lab�eled�������h����v��@ � ff �� ��Return���v�ٚ� ff 뎍� x����i���'/��or�������h����v��@ � ff ���� ��En�Îter���v�ٚ� ff ������:����i���!�k�on�some����Gk��!eyb�M�oards.��h����G�X1.2��Readline�f@In���teraction���ޛ��!G�Often�kduring�an�in��!teractiv�e�ksession�y��!ou�t�yp�M�e�in�a�long�line�of�text,�&jonly�to�notice�that�the����Grst���w��!ord�on�the�line�is�missp�M�elled.��"The�Readline�library�giv�es�y�ou�a�set�of�commands�for����Gmanipulating���the�text�as�y��!ou�t�yp�M�e�it�in,��ballo�wing�y�ou�to�just�x�y�our�t�yp�M�o,��band�not�forcing����Gy��!ou�`�to�ret�yp�M�e�the�ma� ��jorit�y�of�the�line.�ƹUsing�these�editing�commands,�n�y�ou�mo�v�e�the�cursor����Gto��the�place�that�needs�correction,�;Zand�delete�or�insert�the�text�of�the�corrections.�CZThen,����Gwhen��#y��!ou�are�satised�with�the�line,���y�ou�simply�press�������h�������@ � ff ,(�� ��RET�����ٚ� ff ,(���Q�����i����k�.�"Y��eou�do�not�ha�v�e�to�b�M�e�at�the����Gend�N4of�the�line�to�press�������h����9 ��@ � ff ,(�� ��RET���9 �ٚ� ff ,(���⚞���i���{|�;��the�en��!tire�line�is�accepted�regardless�of�the�lo�M�cation�of�the����Gcursor��fwithin�the�line.��h����G�a��N�
#� cmbx12�a1.2.1�d(Readline��MBare�Essen���tials�����!G�In��iorder�to�en��!ter�c�haracters�in�to�the�line,��simply�t�yp�M�e�them.���The�t�yp�M�ed�c�haracter�app�M�ears����Gwhere��Nthe�cursor�w��!as,��Hand�then�the�cursor�mo�v�es�one�space�to�the�righ�t.���If�y�ou�mist�yp�M�e�a����Gc��!haracter,��fy�ou�can�use�y�our�erase�c�haracter�to�bac�k�up�and�delete�the�mist�yp�M�ed�c�haracter.���h��!GSometimes��ly��!ou�ma�y�mist�yp�M�e�a�c�haracter,���and�not�notice�the�error�un�til�y�ou�ha�v�e�t�yp�M�ed����Gsev��!eral�w�other�c�haracters.��cIn�that�case,��Ay�ou�can�t�yp�M�e��C-b��to�mo�v�e�the�cursor�to�the�left,��Aand����Gthen��fcorrect�y��!our�mistak�e.���Afterw�ards,�y�ou�can�mo�v�e�the�cursor�to�the�righ�t�with��C-f�.���� @x��� ���G�2�>�
GNU��fReadline�Library�����3*�����֍�!GWhen��"y��!ou�add�text�in�the�middle�of�a�line,���y�ou�will�notice�that�c�haracters�to�the�righ�t��
33��Gof�q�the�cursor�are�`pushed�o��!v�er'�q�to�mak��!e�ro�M�om�for�the�text�that�y�ou�ha�v�e�inserted.��BLik�ewise,����Gwhen���y��!ou�delete�text�b�M�ehind�the�cursor,��c�haracters�to�the�righ�t�of�the�cursor�are�`pulled����Gbac��!k'���to�ll�in�the�blank�space�created�b�y�the�remo�v��dDal�of�the�text.��A���list�of�the�bare�essen�tials����Gfor��fediting�the�text�of�an�input�line�follo��!ws.������G�C-b�(���Mo��!v�e��fbac�k�one�c�haracter.����G�C-f�(���Mo��!v�e��fforw�ard�one�c�haracter.������G����h�������@ � ff ���� ��DEL�����ٚ� ff �����&
����i���-L��or����f����h�����2��@ � ff &,�� ��Bac�Îkspace����2�ٚ� ff &,,;�����i����
33��K�:�Delete��fthe�c��!haracter�to�the�left�of�the�cursor.����G�C-d�(���Delete��fthe�c��!haracter�underneath�the�cursor.�����GPrin��!ting��fc�haracters�����K�:Insert��fthe�c��!haracter�in�to�the�line�at�the�cursor.����G�C-_��f�or��C-x�C-u����K�:�Undo�jthe�last�editing�command.���Y��eou�can�undo�all�the�w��!a�y�jbac�k�to�an�empt�y����K�:line.����G(Dep�M�ending�on�y��!our�conguration,�0�the�������h�����؟�@ � ff &,�� ��Bac�Îkspace����؟ٚ� ff &,,�;����i���4X)�k�ey�b�M�e�set�to�delete�the�c�haracter�to�the����Gleft���of�the�cursor�and�the�������h����ዟ�@ � ff ���� ��DEL���ዟٚ� ff �����������i������k��!ey�set�to�delete�the�c�haracter�underneath�the�cursor,�
�lik�e����G�C-d�,��frather�than�the�c��!haracter�to�the�left�of�the�cursor.)��:����G�a1.2.2�d(Readline��MMo���v�emen�t�Commands���$���!G�The�"�ab�M�o��!v�e�table�describ�M�es�the�most�basic�k�eystrok�es�that�y�ou�need�in�order�to�do�editing����Gof��the�input�line.���F��eor�y��!our�con�v�enience,�-�man�y�other�commands�ha�v�e�b�M�een�added�in�addition����Gto����C-b�,���C-f�,��C-d�,�and�������h��������@ � ff ���� ��DEL������ٚ� ff ������-����i���l�.�o�Here�are�some�commands�for�mo��!ving�more�rapidly�ab�M�out�the����Gline.����G�C-a�(���Mo��!v�e��fto�the�start�of�the�line.����G�C-e�(���Mo��!v�e��fto�the�end�of�the�line.����G�M-f�(���Mo��!v�e��fforw�ard�a�w�ord,�where�a�w�ord�is�comp�M�osed�of�letters�and�digits.����G�M-b�(���Mo��!v�e��fbac�kw�ard�a�w�ord.����G�C-l�(���Clear��fthe�screen,�reprin��!ting�the�curren�t�line�at�the�top.����!GNotice��Kho��!w��C-f��mo�v�es�forw�ard�a�c�haracter,��while��M-f��mo�v�es�forw�ard�a�w�ord.��It�is�a�lo�M�ose����Gcon��!v�en�tion���that�con��!trol�k�eystrok�es�op�M�erate�on�c�haracters�while�meta�k�eystrok�es�op�M�erate�on����Gw��!ords.��:����G�a1.2.3�d(Readline��MKilling�Commands���$���!G�Killing�l�text�{�means�to�delete�the�text�from�the�line,��Jbut�to�sa��!v�e�{�it�a��!w�a�y�{�for�later�use,����Gusually�Zb��!y��y�anking�r�(re-inserting)�it�bac�k�in�to�the�line.�3�(`Cut'�and�`paste'�are�more�recen�t����Gjargon��ffor�`kill'�and�`y��!ank'.)���_��!GIf���the�description�for�a�command�sa��!ys�that�it�`kills'�text,���then�y�ou�can�b�M�e�sure�that�y�ou����Gcan��fget�the�text�bac��!k�in�a�dieren�t�(or�the�same)�place�later.���� V��� ���G�Chapter��f1:���Command�Line�Editing�MH3�����3*�����֍�!GWhen�ʛy��!ou�use�a�kill�command,���the�text�is�sa�v�ed�in�a��kill-ring�.���An�y�n�um�b�M�er�of�consecutiv�e��
33��Gkills��$sa��!v�e�all�of�the�killed�text�together,���so�that�when�y�ou�y�ank�it�bac�k,���y�ou�get�it�all.�The����Gkill���ring�is�not�line�sp�M�ecic;�(the�text�that�y��!ou�killed�on�a�previously�t�yp�M�ed�line�is�a�v��dDailable����Gto��fb�M�e�y��!ank�ed��fbac�k�later,�when�y�ou�are�t�yping�another�line.���獑!GHere��fis�the�list�of�commands�for�killing�text.��ě��G�C-k�(���Kill��fthe�text�from�the�curren��!t�cursor�p�M�osition�to�the�end�of�the�line.����G�M-d�(���Kill�)�from�the�cursor�to�the�end�of�the�curren��!t�w�ord,�B�or,�if�)�b�M�et�w�een�w�ords,�B�to�the��
33��K�:end��fof�the�next�w��!ord.���W��eord�b�M�oundaries�are�the�same�as�those�used�b�y��M-f�.����G�M-������h�����̟�@ � ff ���� ��DEL����̟ٚ� ff ������8����i���.Q��Kill��ofrom�the�cursor�the�start�of�the�curren��!t�w�ord,���or,�if��ob�M�et�w�een�w�ords,���to�the����K�:start��of�the�previous�w��!ord.���W��eord�b�M�oundaries�are�the�same�as�those�used�b�y����K�:�M-b�.����G�C-w�(���Kill��xfrom�the�cursor�to�the�previous�whitespace.�,This�is�dieren��!t�than��M-������h�����̟�@ � ff ���� ��DEL����̟ٚ� ff ������8����i������K�:�b�M�ecause��fthe�w��!ord�b�oundaries�dier.����!GHere���is�ho��!w�to��y�ank����the�text�bac�k�in�to�the�line.��NY��eanking�means�to�cop�y�the�most-����Grecen��!tly-killed��ftext�from�the�kill�buer.����G�C-y�(���Y��eank��fthe�most�recen��!tly�killed�text�bac�k�in�to�the�buer�at�the�cursor.����G�M-y�(���Rotate�'!the�kill-ring,�GPand�y��!ank�the�new�top.�`Y��eou�can�only�do�this�if�the�prior����K�:command��fis��C-y��or��M-y�.��Z���G�a1.2.4�d(Readline��MArgumen���ts���/��!G�Y��eou���can�pass�n��!umeric�argumen�ts�to�Readline�commands.��Sometimes�the�argumen�t�acts����Gas�Ѥa�rep�M�eat�coun��!t,�sother�times�it�is�the��sign����of�the�argumen�t�that�is�signican�t.�_�If�y�ou����Gpass�a�negativ��!e�argumen�t�to�a�command�whic�h�normally�acts�in�a�forw�ard�direction,��that����Gcommand�=�will�act�in�a�bac��!kw�ard�=�direction.��?F��eor�example,�c�to�kill�text�bac��!k�to�the�start�of����Gthe��fline,�y��!ou�migh�t�t�yp�M�e�`�M--�C-k�'.���獑!GThe�bOgeneral�w��!a�y�bOto�pass�n��!umeric�argumen�ts�to�a�command�is�to�t�yp�M�e�meta�digits�b�efore����Gthe���command.�RIf�the�rst�`digit'�t��!yp�M�ed�is�a�min�us�sign�(`�-�'),��then�the�sign�of�the�argumen�t����Gwill���b�M�e�negativ��!e.��HOnce�y�ou�ha�v�e�t�yp�M�ed�one�meta�digit�to�get�the�argumen�t�started,�Ғy�ou����Gcan�v�t��!yp�M�e�the�remainder�of�the�digits,��oand�then�the�command.��F��eor�example,�to�giv��!e�the��C-d����G�command�~Gan�argumen��!t�of�10,��?y�ou�could�t�yp�M�e�`�M-1��f0�C-d�',��?whic�h�~Gwill�delete�the�next�ten����Gc��!haracters��fon�the�input�line.�����G�a1.2.5�d(Searc���hing��Mfor�Commands�in�the�History���/��!G�Readline��Tpro��!vides�commands�for�searc�hing�through�the�command�history�for�lines�con-����Gtaining��fa�sp�M�ecied�string.���There�are�t��!w�o��fsearc�h�mo�M�des:����incremen�tal���and��non-incremen�tal�.���獑!GIncremen��!tal��searc�hes�b�M�egin�b�efore�the�user�has�nished�t��!yping�the�searc�h�string.���As�eac�h����Gc��!haracter�@|of�the�searc�h�string�is�t�yp�M�ed,�gReadline�displa�ys�the�next�en�try�from�the�history����Gmatc��!hing��+the�string�t�yp�M�ed�so�far.��tAn�incremen�tal�searc�h�requires�only�as�man�y�c�haracters�as����Gneeded�t�to�nd�the�desired�history�en��!try��e.��bT�o�t�searc�h�bac�kw�ard�in�the�history�for�a�particular����Gstring,��0t��!yp�M�e��c�C-r�.��1T�yping��C-s��searc�hes�forw�ard�through�the�history��e.��1The�c�haracters�presen�t����Gin��^the�v��dDalue�of�the��isearch-terminators��v�ariable�are�used�to�terminate�an�incremen��!tal���� bߍ�� ���G�4�>�
GNU��fReadline�Library�����3*�����֍�Gsearc��!h.���If��Nthat�v��dDariable�has�not�b�M�een�assigned�a�v�alue,���the�������h����s��@ � ff �T�� ��ESC���s�ٚ� ff �T���������i�����and��C-J��c��!haracters�will��
33��Gterminate�Can�incremen��!tal�searc�h.� 3t�C-g��will�ab�M�ort�an�incremen�tal�searc�h�and�restore�the����Goriginal�x�line.�άWhen�the�searc��!h�is�terminated,���the�history�en�try�con�taining�the�searc�h�string����Gb�M�ecomes��fthe�curren��!t�line.�� ��!GT��eo���nd�other�matc��!hing�en�tries�in�the�history�list,���t�yp�M�e��C-r��or��C-s��as�appropriate.��This����Gwill�#�searc��!h�bac�kw�ard�or�forw�ard�in�the�history�for�the�next�en�try�matc�hing�the�searc�h�string����Gt��!yp�M�ed��5so�far.��IAn�y�other�k�ey�sequence�b�M�ound�to�a�Readline�command�will�terminate�the����Gsearc��!h���and�execute�that�command.�~=F��eor�instance,���a�������h����rP��@ � ff ,(�� ��RET���rP�ٚ� ff ,(���ꞙ��i���<P�will�terminate�the�searc�h�and�accept����Gthe���line,��5thereb��!y�executing�the�command�from�the�history�list.���A���mo�v�emen�t�command�will����Gterminate��fthe�searc��!h,�mak�e�the�last�line�found�the�curren�t�line,�and�b�M�egin�editing.����!GReadline�.�remem��!b�M�ers�the�last�incremen�tal�searc�h�string.�vhIf�t�w�o��C-r�s�are�t�yp�M�ed�without����Gan��!y�a�in�terv�ening�c�haracters�dening�a�new�searc�h�string,���an�y�remem�b�M�ered�searc�h�string�is����Gused.����!GNon-incremen��!tal���searc�hes�read�the�en�tire�searc�h�string�b�M�efore�starting�to�searc�h�for����Gmatc��!hing��history�lines.� F�The�searc�h�string�ma�y�b�M�e�t�yp�M�ed�b�y�the�user�or�b�M�e�part�of�the����Gcon��!ten�ts��fof�the�curren��!t�line.��! ���G�X1.3��Readline�f@Init�File���33��!G�Although�lthe�Readline�library�comes�with�a�set�of�Emacs-lik��!e�k�eybindings�installed����Gb��!y�default,�W�it�is�p�M�ossible�to�use�a�dieren�t�set�of�k�eybindings.���An�y�user�can�customize����Gprograms���that�use�Readline�b��!y�putting�commands�in�an��inputrc����le,���con�v�en�tionally�in�his����Ghome��directory��e.���The�name�of�this�le�is�tak��!en�from�the�v��dDalue�of�the�en�vironmen�t�v��dDariable����G�INPUTRC�.���If��fthat�v��dDariable�is�unset,�the�default�is�`�~/.inputrc�'.����!GWhen��\a�program�whic��!h�uses�the�Readline�library�starts�up,��*the�init�le�is�read,�and�the����Gk��!ey��fbindings�are�set.����!GIn�8�addition,�N�the��C-x��fC-r��command�re-reads�this�init�le,�th��!us�incorp�M�orating�an�y�c�hanges����Gthat��fy��!ou�migh�t�ha�v�e�made�to�it.�������G�a1.3.1�d(Readline��MInit�File�Syn���tax���33��!G�There��are�only�a�few�basic�constructs�allo��!w�ed��in�the�Readline�init�le.�
RBlank�lines�are����Gignored.��zLines��b�M�eginning�with�a�`�#�'�are�commen��!ts.�Lines�b�M�eginning�with�a�`�$�'�indicate����Gconditional�R�constructs�(see�Section�1.3.2�[Conditional�Init�Constructs],�cbpage�9).���Other�lines����Gdenote��fv��dDariable�settings�and�k��!ey�bindings.��ff��GV��eariable��fSettings����K�:Y��eou�ڽcan�mo�M�dify�the�run-time�b�eha��!vior�of�Readline�b�y�altering�the�v��dDalues�of����K�:v��dDariables�din�Readline�using�the��set��command�within�the�init�le.��The�syn��!tax����K�:is��fsimple:������hʏ�set����variable�value����K�:�Here,�X�for�E|example,�is�ho��!w�to�c�hange�from�the�default�Emacs-lik�e�k�ey�binding�to��
33��K�:use��f�vi��line�editing�commands:����hʏ�set���editing-mode�vi���� r���� ���G�Chapter��f1:���Command�Line�Editing�MH5�����3*�����֍�K�:V��eariable�4Ynames�and�v��dDalues,�W�where�appropriate,�are�recognized�without�regard��
33��K�:to��fcase.���Unrecognized�v��dDariable�names�are�ignored.��ff��K�:Bo�M�olean��v��dDariables�(those�that�can�b�e�set�to�on�or�o� �)�are�set�to�on�if�the�v��dDalue�is����K�:n��!ull��Jor�empt�y��e,��on��(case-insensitiv�e),�or�1.���An�y�other�v��dDalue�results�in�the�v�ariable����K�:b�M�eing��fset�to�o.����K�:A��fgreat�deal�of�run-time�b�M�eha��!vior�is�c�hangeable�with�the�follo�wing�v��dDariables.������K�:�bell-style���� ��-�Con��!trols�Fwhat�happ�M�ens�when�Readline�w�an�ts�to�ring�the�termi-���� ��-nal�xzb�M�ell.�TIf�set�to�`�none�',���Readline�nev��!er�rings�the�b�ell.�TIf�set�to���� ��-`�visible�',�
dReadline��euses�a�visible�b�M�ell�if�one�is�a��!v��dDailable.���If�set�to���� ��-`�audible�'��(the�default),��6Readline�attempts�to�ring�the�terminal's���� ��-b�M�ell.����K�:�bind-tty-special-chars���� ��-�If�pset�to�`�on�',��jReadline�attempts�to�bind�the�con��!trol�c�haracters���� ��-treated�A�sp�M�ecially�b��!y�the�k�ernel's�terminal�driv�er�to�their�Readline���� ��-equiv��dDalen��!ts.����K�:�comment-begin���� ��-�The���string�to�insert�at�the�b�M�eginning�of�the�line�when�the��insert-���� ��-comment��f�command�is�executed.���The�default�v��dDalue�is��"#"�.����K�:�completion-ignore-case���� ��-�If�I�set�to�`�on�',�\WReadline�p�M�erforms�lename�matc��!hing�and�completion���� ��-in��fa�case-insensitiv��!e�fashion.���The�default�v��dDalue�is�`�off�'.����K�:�completion-query-items���� ��-�The�%�n��!um�b�M�er�of�p�ossible�completions�that�determines�when�the�user���� ��-is��Hask��!ed�whether�the�list�of�p�M�ossibilities�should�b�e�displa��!y�ed.��(If��Hthe���� ��-n��!um�b�M�er�9of�p�ossible�completions�is�greater�than�this�v��dDalue,�N�Readline���� ��-will�.�ask�the�user�whether�or�not�he�wishes�to�view�them;�Vzotherwise,���� ��-they���are�simply�listed.��XThis�v��dDariable�m��!ust�b�M�e�set�to�an�in�teger�v��dDalue���� ��-greater���than�or�equal�to�0.���A���negativ��!e�v��dDalue�means�Readline�should���� ��-nev��!er��fask.���The�default�limit�is��100�.����K�:�convert-meta���� ��-�If���set�to�`�on�',���Readline�will�con��!v�ert���c�haracters�with�the�eigh�th�bit�set���� ��-to���an��asci�>Ki��k��!ey�sequence�b�y�stripping�the�eigh�th�bit�and�prexing�an������ ��-����h���� �����@ � ff �T�� ��ESC��� ����ٚ� ff �T��� �������i��� �jz�c��!haracter,�,�con�v�erting��them�to�a�meta-prexed�k��!ey�sequence.���� ��-The��fdefault�v��dDalue�is�`�on�'.����K�:�disable-completion���� ��-�If�gset�to�`�On�',��@Readline�will�inhibit�w��!ord�completion.��Completion���� ��-c��!haracters�!�will�b�M�e�inserted�in�to�the�line�as�if�they�had�b�M�een�mapp�ed���� ��-to��f�self-insert�.���The�default�is�`�off�'.����K�:�editing-mode���� ��-�The�r��editing-mode��v��dDariable�con��!trols�whic�h�default�set�of�k�ey�bind-���� ��-ings�?is�used.��%By�default,�#Readline�starts�up�in�Emacs�editing�mo�M�de,���� ��-where�~�the�k��!eystrok�es�~�are�most�similar�to�Emacs.�ПThis�v��dDariable�can���� ��-b�M�e��fset�to�either�`�emacs�'�or�`�vi�'.���� �v��� ���G�6�>�
GNU��fReadline�Library�����3*�����֍�K�:�enable-keypad��
33�� ��-�When���set�to�`�on�',��mReadline�will�try�to�enable�the�application�k��!eypad���� ��-when�1�it�is�called.��Some�systems�need�this�to�enable�the�arro��!w�k�eys.���� ��-The��fdefault�is�`�off�'.�����K�:�expand-tilde���� ��-�If�Pset�to�`�on�',�a[tilde�expansion�is�p�M�erformed�when�Readline�attempts���� ��-w��!ord��fcompletion.���The�default�is�`�off�'.����K�:�history-preserve-point���� ��-�If���set�to�`�on�',���the�history�co�M�de�attempts�to�place�p�oin��!t�at�the�same���� ��-lo�M�cation�Kon�eac��!h�history�line�retriev�ed�with��previous-history��or���� ��-�next-history�.���The��fdefault�is�`�off�'.����K�:�horizontal-scroll-mode���� ��-�This�N�v��dDariable�can�b�M�e�set�to�either�`�on�'�or�`�off�'.��
Setting�it�to�`�on�'���� ��-means�$jthat�the�text�of�the�lines�b�M�eing�edited�will�scroll�horizon��!tally���� ��-on���a�single�screen�line�when�they�are�longer�than�the�width�of�the���� ��-screen,�:�instead��of�wrapping�on��!to�a�new�screen�line.��By�default,�this���� ��-v��dDariable��fis�set�to�`�off�'.����K�:�input-meta���� ��-�If���set�to�`�on�',���Readline�will�enable�eigh��!t-bit�input�(it�will�not�clear���� ��-the��"eigh��!th�bit�in�the�c�haracters�it�reads),�
Pregardless�of�what�the���� ��-terminal���claims�it�can�supp�M�ort.�Q-The�default�v��dDalue�is�`�off�'.�The���� ��-name��f�meta-flag��is�a�synon��!ym�for�this�v��dDariable.����K�:�isearch-terminators���� ��-�The�5�string�of�c��!haracters�that�should�terminate�an�incremen�tal���� ��-searc��!h��|without�subsequen�tly�executing�the�c�haracter�as�a�command���� ��-(see�Z�Section�1.2.5�[Searc��!hing],���page�3).� ��If�this�v��dDariable�has�not���� ��-b�M�een�DŽgiv��!en�a�v��dDalue,���the�c�haracters�������h�����P��@ � ff �T�� ��ESC����P�ٚ� ff �T��������i���4|�and��C-J��will�terminate�an���� ��-incremen��!tal��fsearc�h.����K�:�keymap�R��Sets��5Readline's�idea�of�the�curren��!t�k�eymap�for�k�ey�binding�com-���� ��-mands.� �Acceptable�SO�keymap��names�are��emacs�,����emacs-standard�,���� ��-�emacs-meta�,�0�emacs-ctlx�,��vi�,��vi-move�,��vi-command�,�and���� ��-�vi-insert�.����vi����is�equiv��dDalen��!t�to��vi-command�;�2��emacs��is�equiv�alen��!t���� ��-to�ӯ�emacs-standard�.�e�The�default�v��dDalue�is��emacs�.�The�v��dDalue�of�the���� ��-�editing-mode��f�v��dDariable�also�aects�the�default�k��!eymap.����K�:�mark-directories���� ��-�If���set�to�`�on�',���completed�directory�names�ha��!v�e���a�slash�app�M�ended.���� ��-The��fdefault�is�`�on�'.����K�:�mark-modified-lines���� ��-�This�N�v��dDariable,�x�when�set�to�`�on�',�causes�Readline�to�displa��!y�an�as-���� ��-terisk��(`�*�')�at�the�start�of�history�lines�whic��!h�ha�v�e�b�M�een�mo�died.���� ��-This��fv��dDariable�is�`�off�'�b��!y�default.���� �;��� ���G�Chapter��f1:���Command�Line�Editing�MH7�����3*�����֍�K�:�mark-symlinked-directories��
33�� ��-�If�_�set�to�`�on�',���completed�names�whic��!h�are�sym�b�M�olic�links�to�di-���� ��-rectories��|ha��!v�e�a�slash�app�M�ended�(sub� ��ject�to�the�v��dDalue�of��mark-���� ��-directories�).���The��fdefault�is�`�off�'.��ii��K�:�match-hidden-files���� ��-�This��sv��dDariable,�ݣwhen�set�to�`�on�',�causes�Readline�to�matc��!h�les�whose���� ��-names�M�b�M�egin�with�a�`�.�'�(hidden�les)�when�p�erforming�lename���� ��-completion,�R unless���the�leading�`�.�'�is�supplied�b��!y�the�user�in�the���� ��-lename��fto�b�M�e�completed.���This�v��dDariable�is�`�on�'�b��!y�default.����K�:�output-meta���� ��-�If�Aset�to�`�on�',�g�Readline�will�displa��!y�c�haracters�with�the�eigh�th�bit���� ��-set�`!directly�rather�than�as�a�meta-prexed�escap�M�e�sequence.�The���� ��-default��fis�`�off�'.����K�:�page-completions���� ��-�If��set�to�`�on�',�,�Readline�uses�an�in��!ternal��more�-lik�e�pager�to�displa�y���� ��-a��screenful�of�p�M�ossible�completions�at�a�time.���This�v��dDariable�is�`�on�'���� ��-b��!y��fdefault.����K�:�print-completions-horizontally���� ��-�If��set�to�`�on�',��Readline�will�displa��!y�completions�with�matc�hes�sorted���� ��-horizon��!tally�8�in�alphab�M�etical�order,��orather�than�do�wn�the�screen.���� ��-The��fdefault�is�`�off�'.����K�:�show-all-if-ambiguous���� ��-�This��]alters�the�default�b�M�eha��!vior�of�the�completion�functions.�مIf�set���� ��-to�L`�on�',�^.w��!ords�whic�h�ha�v�e�more�than�one�p�M�ossible�completion�cause���� ��-the��matc��!hes�to�b�M�e�listed�immediately�instead�of�ringing�the�b�ell.���� ��-The��fdefault�v��dDalue�is�`�off�'.����K�:�show-all-if-unmodified���� ��-�This���alters�the�default�b�M�eha��!vior�of�the�completion�functions�in�a���� ��-fashion��similar�to��sho��!w-all-if-am�biguous�.���If��set�to�`�on�',�-�w��!ords�whic�h���� ��-ha��!v�e���more�than�one�p�M�ossible�completion�without�an��!y�p�ossible�par-���� ��-tial��completion�(the�p�M�ossible�completions�don't�share�a�common���� ��-prex)��cause�the�matc��!hes�to�b�M�e�listed�immediately�instead�of�ring-���� ��-ing��fthe�b�M�ell.���The�default�v��dDalue�is�`�off�'.����K�:�visible-stats���� ��-�If��vset�to�`�on�',���a�c��!haracter�denoting�a�le's�t�yp�M�e�is�app�ended�to�the���� ��-lename��fwhen�listing�p�M�ossible�completions.���The�default�is�`�off�'.����GKey��fBindings����K�:The�syn��!tax�for�con�trolling�k�ey�bindings�in�the�init�le�is�simple.� First�y�ou����K�:need�Q�to�nd�the�name�of�the�command�that�y��!ou�w�an�t�to�c�hange.���The�follo�wing����K�:sections�Ocon��!tain�tables�of�the�command�name,�yLthe�default�k�eybinding,�yLif�an�y��e,����K�:and��fa�short�description�of�what�the�command�do�M�es.��NN��K�:Once�P�y��!ou�kno�w�the�name�of�the�command,�{
simply�place�on�a�line�in�the�init����K�:le�the�name�of�the�k��!ey�y�ou�wish�to�bind�the�command�to,�$'a�colon,�and�then���� ����� ���G�8�>�
GNU��fReadline�Library�����3*�����֍�K�:the�֫name�of�the�command.�n�The�name�of�the�k��!ey�can�b�M�e�expressed�in�dieren�t��
33��K�:w��!a�ys,��fdep�M�ending�on�what�y��!ou�nd�most�comfortable.��� ��K�:In�S�addition�to�command�names,�<readline�allo��!ws�k�eys�to�b�M�e�b�ound�to�a�string����K�:that��fis�inserted�when�the�k��!ey�is�pressed�(a��macro� ���).���͍��K�:�k��!eyname� ��:����function-name�Cm�or��f�macro����� ��-k��!eyname�j�is�tcthe�name�of�a�k�ey�sp�M�elled�out�in�English.��1F��eor�example:���� ����Control-u:���universal-argument���� ���Meta-Rubout:���backward-kill-word���� ���Control-o:���">�output"���� ��-�In��3the�ab�M�o��!v�e��3example,����C-u��is�b�ound�to�the�function��universal-���� ��-argument�,����M-DEL����is�b�M�ound�to�the�function��backward-kill-word�,���� ��-and����C-o��is�b�M�ound�to�run�the�macro�expressed�on�the�righ��!t�hand���� ��-side��f(that�is,�to�insert�the�text�`�>�output�'�in��!to�the�line).���� ��-A�q n��!um�b�M�er�q4of�sym��!b�olic�c��!haracter�names�are�recognized�while�pro-���� ��-cessing���this�k��!ey�binding�syn�tax:�u%�DEL�,��ESC�,��ESCAPE�,��LFD�,��NEW-���� ��-LINE�,��f�RET�,��RETURN�,��R��!UBOUT�,��SP��eA�CE�,��SPC�,�and��T��eAB�.���͍��K�:�"�k��!eyseq�@��"�:����function-name�Cm�or��f�macro����� ��-k��!eyseq����diers���from��k�eyname�V��ab�M�o�v�e�in�that�strings�denoting�an�en-���� ��-tire�hk��!ey�sequence�can�b�M�e�sp�ecied,�%�b��!y�placing�the�k�ey�sequence�in���� ��-double���quotes.��bSome��gnu��Emacs�st��!yle�k�ey�escap�M�es�can�b�e�used,���as���� ��-in��the�follo��!wing�example,�(�but�the�sp�M�ecial�c�haracter�names�are�not���� ��-recognized.���� ����"\C-u":���universal-argument���� ���"\C-x\C-r":���re-read-init-file���� ���"\e[11~":���"Function�Key�1"���� ��-�In���the�ab�M�o��!v�e���example,����C-u��is�again�b�ound�to�the�function���� ��-�universal-argument�?��(just�as�it�w��!as�in�the�rst�example),��=`�C-x���� ��-C-r�'��pis�b�M�ound�to�the�function��re-read-init-file�,�F�and�`������h�����̟�@ � ff �T�� ��ESC����̟ٚ� ff �T��������i�����Kڞ��h����6���@ � ff \t�� ��[���6�� � ff \t��������i�������� ��-���h���� �����@ � ff @�� ��1��� ����ٚ� ff @��� �[o����i����� ������h���� �����@ � ff @�� ��1��� ����ٚ� ff @��� �B�����i����� ��A���h���� �m
��@ � ff ���� ��~��� �m
�ٚ� ff ����� ��)����i��� �C�'��fis�b�M�ound�to�insert�the�text�`�Function�Key�1�'.���͍�K�:The���follo��!wing��gnu��Emacs�st�yle�escap�M�e�sequences�are�a�v��dDailable�when�sp�M�ecifying����K�:k��!ey��fsequences:����K�:�\C-�(���con��!trol��fprex����K�:�\M-�(���meta��fprex����K�:�\e�.Q��an��fescap�M�e�c��!haracter����K�:�\\�.Q��bac��!kslash����K�:�\�"���.Q�����h����1<k��@ � ff ���� ��"���1<k�ٚ� ff �����6y�����i���:i�,��fa�double�quotation�mark����K�:�\'���.Q�����h����1<k��@ � ff \t�� ��'���1<k�ٚ� ff \t���3Q����i���6�3�,��fa�single�quote�or�ap�M�ostrophe����K�:In�Qaddition�to�the��gnu��Emacs�st��!yle�escap�M�e�sequences,�b)a�second�set�of�bac�kslash����K�:escap�M�es��fis�a��!v��dDailable:����K�:�\a�.Q��alert��f(b�M�ell)���� ����� ���G�Chapter��f1:���Command�Line�Editing�MH9�����3*�����֍�K�:�\b�.Q��bac��!kspace�����K�:�\d�.Q��delete����K�:�\f�.Q��form��ffeed����K�:�\n�.Q��newline����K�:�\r�.Q��carriage��freturn����K�:�\t�.Q��horizon��!tal��ftab����K�:�\v�.Q��v��!ertical��ftab����K�:�\�nnn�"�K�the�$�eigh��!t-bit�c�haracter�whose�v��dDalue�is�the�o�M�ctal�v�alue��nnn��(one�to��
33�� ��-three��fdigits)����K�:�\x�HH�"�K�the���eigh��!t-bit�c�haracter�whose�v��dDalue�is�the�hexadecimal�v�alue��HH���� ��-�(one��for�t��!w�o��fhex�digits)����K�:When�}�en��!tering�the�text�of�a�macro,���single�or�double�quotes�m�ust�b�M�e�used�to����K�:indicate���a�macro�denition.��?Unquoted�text�is�assumed�to�b�M�e�a�function�name.�In����K�:the���macro�b�M�o�dy��e,��~the���bac��!kslash�escap�M�es�describ�ed�ab�o��!v�e���are�expanded.���Bac��!kslash����K�:will��quote�an��!y�other�c�haracter�in�the�macro�text,��including�`�"�'�and�`�'�'.�R F��eor����K�:example,�4 the��follo��!wing�binding�will�mak�e�`�C-x��f�\�'�insert�a�single�`�\�'�in�to�the�line:�����hʏ�"\C-x\\":���"\\"��z8���G�a1.3.2�d(Conditional��MInit�Constructs���9�!G�Readline�?�implemen��!ts�a�facilit�y�similar�in�spirit�to�the�conditional�compilation�features����Gof�$the�C�#�prepro�M�cessor�whic��!h�allo�ws�k�ey�bindings�and�v��dDariable�settings�to�b�M�e�p�erformed�as����Gthe��fresult�of�tests.���There�are�four�parser�directiv��!es�used.����G�$if�(���The��N�$if��construct�allo��!ws�bindings�to�b�M�e�made�based�on�the�editing�mo�de,�ʈthe����K�:terminal���b�M�eing�used,�͘or�the�application�using�Readline.��VThe�text�of�the�test����K�:extends��fto�the�end�of�the�line;�no�c��!haracters�are�required�to�isolate�it.����K�:�mode�"�K�The��[�mode=��form�of�the��$if��directiv��!e�is�used�to�test�whether�Readline���� ��-is���in��emacs��or��vi��mo�M�de.��DThis�ma��!y�b�e�used�in�conjunction�with�the���� ��-`�set��fkeymap�'�N
command,�_�for�instance,�to�set�bindings�in�the��emacs-���� ��-standard�_�and��emacs-ctlx��k��!eymaps�only�if�Readline�is�starting�out���� ��-in��f�emacs��mo�M�de.����K�:�term�"�K�The�<�term=��form�ma��!y�b�M�e�used�to�include�terminal-sp�ecic�k��!ey�bind-���� ��-ings,��p�M�erhaps�V�to�bind�the�k��!ey�sequences�output�b�y�the�terminal's���� ��-function�ހk��!eys.��;The�w�ord�on�the�righ�t�side�of�the�`�=�'�is�tested�against���� ��-b�M�oth��Pthe�full�name�of�the�terminal�and�the�p�ortion�of�the�terminal���� ��-name��b�M�efore�the�rst�`�-�'.��/This�allo��!ws��sun��to�matc�h�b�M�oth��sun��and���� ��-�sun-cmd�,��ffor�instance.����K�:�application���� ��-�The����application��construct�is�used�to�include�application-sp�M�ecic�set-���� ��-tings.��mEac��!h��program�using�the�Readline�library�sets�the��application���� ��-name�,��wand��<y��!ou�can�test�for�a�particular�v��dDalue.��$This�could�b�M�e�used�to����
����� ���G�10�9pGNU��fReadline�Library�����3*�����֍� ��-bind��Dk��!ey�sequences�to�functions�useful�for�a�sp�M�ecic�program.��wF��eor��
33�� ��-instance,��the���follo��!wing�command�adds�a�k�ey�sequence�that�quotes���� ��-the��fcurren��!t�or�previous�w�ord�in�Bash:��33�� ����$if���Bash���� ���#���Quote�the�current�or�previous�word���� ���"\C-xq":���"\eb\"\ef\""���� ���$endif��33��G$endif�R��This���command,��(as�seen�in�the�previous�example,�terminates�an��$if��command.����G�$else���Commands��fin�this�branc��!h�of�the��$if��directiv�e�are�executed�if�the�test�fails.����G�$include�ӣ�This�:directiv��!e�tak�es�a�single�lename�as�an�argumen�t�and�reads�commands��
33��K�:and���bindings�from�that�le.��F��eor�example,��#the�follo��!wing�directiv�e�reads�from����K�:`�/etc/inputrc�':����hʏ�$include���/etc/inputrc�� ���G�a1.3.3�d(Sample��MInit�File���ff��!G�Here���is�an�example�of�an��inputrc�R��le.��This�illustrates�k��!ey�binding,���v��dDariable�assignmen�t,����Gand��fconditional�syn��!tax.���� �Z��� ���G�Chapter��f1:���Command�Line�Editing� �Ӯ11�����3*���� ��.���#���This�file�controls�the�behaviour�of�line�input�editing�for��
33��.��#���programs�that�use�the�GNU�Readline�library.�TExisting����.��#���programs�include�FTP,�Bash,�and�GDB.����.��#����.��#���You�can�re-read�the�inputrc�file�with�C-x�C-r.����.��#���Lines�beginning�with�'#'�are�comments.����.��#����.��#���First,�include�any�systemwide�bindings�and�variable����.��#���assignments�from�/etc/Inputrc����.��$include���/etc/Inputrc��ff��.��#����.��#���Set�various�bindings�for�emacs�mode.����.��set���editing-mode�emacs����.��$if���mode=emacs����.��Meta-Control-h:�Tbackward-kill-word���Text�after�the�function�name�is�ignored�n� ����.��#����.��#���Arrow�keys�in�keypad�mode����.��#����.��#"\M-OD":�-�Pbackward-char����.��#"\M-OC":�-�Pforward-char����.��#"\M-OA":�-�Pprevious-history����.��#"\M-OB":�-�Pnext-history����.��#����.��#���Arrow�keys�in�ANSI�mode����.��#����.��"\M-[D":�-�Pbackward-char����.��"\M-[C":�-�Pforward-char����.��"\M-[A":�-�Pprevious-history����.��"\M-[B":�-�Pnext-history����.��#����.��#���Arrow�keys�in�8�bit�keypad�mode����.��#����.��#"\M-\C-OD":�(=�backward-char����.��#"\M-\C-OC":�(=�forward-char����.��#"\M-\C-OA":�(=�previous-history����.��#"\M-\C-OB":�(=�next-history����.��#����.��#���Arrow�keys�in�8�bit�ANSI�mode����.��#����.��#"\M-\C-[D":�(=�backward-char����.��#"\M-\C-[C":�(=�forward-char���� ����� ���G�12�9pGNU��fReadline�Library�����3*�����֍�.���#"\M-\C-[A":�(=�previous-history��
33��.��#"\M-\C-[B":�(=�next-history��ff��.��C-q:���quoted-insert����.��$endif����.��#���An�old-style�binding.�TThis�happens�to�be�the�default.����.��TAB:���complete����.��#���Macros�that�are�convenient�for�shell�interaction����.��$if���Bash����.��#���edit�the�path����.��"\C-xp":���"PATH=${PATH}\e\C-e\C-a\ef\C-f"����.��#���prepare�to�type�a�quoted�word�--����.��#���insert�open�and�close�double�quotes����.��#���and�move�to�just�after�the�open�quote����.��"\C-x\"":���"\"\"\C-b"����.��#���insert�a�backslash�(testing�backslash�escapes����.��#���in�sequences�and�macros)����.��"\C-x\\":���"\\"����.��#���Quote�the�current�or�previous�word����.��"\C-xq":���"\eb\"\ef\""����.��#���Add�a�binding�to�refresh�the�line,�which�is�unbound����.��"\C-xr":���redraw-current-line����.��#���Edit�variable�on�current�line.����.��"\M-\C-v":���"\C-a\C-k$\C-y\M-\C-e\C-a\C-y="����.��$endif����.��#���use�a�visible�bell�if�one�is�available����.��set���bell-style�visible����.��#���don't�strip�characters�to�7�bits�when�reading����.��set���input-meta�on����.��#���allow�iso-latin1�characters�to�be�inserted�rather����.��#���than�converted�to�prefix-meta�sequences����.��set���convert-meta�off����.��#���display�characters�with�the�eighth�bit�set�directly����.��#���rather�than�as�meta-prefixed�characters����.��set���output-meta�on����.��#���if�there�are�more�than�150�possible�completions�for����.��#���a�word,�ask�the�user�if�he�wants�to�see�all�of�them����.��set���completion-query-items�150����
�p��� ���G�Chapter��f1:���Command�Line�Editing� �Ӯ13�����3*�����֍�.���#���For�FTP��
33��.��$if���Ftp����.��"\C-xg":���"get�\M-?"����.��"\C-xt":���"put�\M-?"����.��"\M-.":���yank-last-arg����.��$endif��8㍍�G�X1.4��Bindable�f@Readline�Commands���$��!G�This���section�describ�M�es�Readline�commands�that�ma��!y�b�e�b�ound�to�k��!ey�sequences.�6Com-����Gmand��fnames�without�an�accompan��!ying�k�ey�sequence�are�un�b�M�ound�b�y�default.���ԍ�!GIn�%Xthe�follo��!wing�descriptions,�?'�p�M�oin�t�bX�refers�to�the�curren�t�cursor�p�M�osition,�?'and��mark��\�refers����Gto��Aa�cursor�p�M�osition�sa��!v�ed��Ab�y�the��set-mark��command.��oThe�text�b�M�et�w�een�the�p�M�oin�t�and����Gmark��fis�referred�to�as�the��region�.��8㍍�G�a1.4.1�d(Commands��MF��ģor�Mo���ving�����G�beginning-of-line��f(C-a)����K�:�Mo��!v�e��fto�the�start�of�the�curren��!t�line.���u��G�end-of-line��f(C-e)����K�:�Mo��!v�e��fto�the�end�of�the�line.����G�forward-char��f(C-f)����K�:�Mo��!v�e��fforw�ard�a�c�haracter.����G�backward-char��f(C-b)����K�:�Mo��!v�e��fbac�k�a�c�haracter.����G�forward-word��f(M-f)����K�:�Mo��!v�e��kforw�ard�to�the�end�of�the�next�w�ord.�܉W��eords�are�comp�M�osed�of�letters�and����K�:digits.����G�backward-word��f(M-b)����K�:�Mo��!v�e��bac�k�to�the�start�of�the�curren�t�or�previous�w�ord.�|W��eords�are�comp�M�osed����K�:of��fletters�and�digits.����G�clear-screen��f(C-l)����K�:�Clear�2�the�screen�and�redra��!w�the�curren�t�line,�I�lea�ving�the�curren�t�line�at�the�top����K�:of��fthe�screen.����G�redraw-current-line��f()����K�:�Refresh��fthe�curren��!t�line.���By�default,�this�is�un�b�M�ound.��8㍍�G�a1.4.2�d(Commands��MF��ģor�Manipulating�The�History���$��G�accept-line��f(Newline�or�Return)����K�:�Accept�:the�line�regardless�of�where�the�cursor�is.���If�this�line�is�non-empt��!y��e,�^�it����K�:ma��!y��0b�M�e�added�to�the�history�list�for�future�recall�with��add_history()�.�g<If�this����K�:line��fis�a�mo�M�died�history�line,�the�history�line�is�restored�to�its�original�state.���� �荟� ���G�14�9pGNU��fReadline�Library�����3*�����֍�G�previous-history��f(C-p)��
33��K�:�Mo��!v�e��f`bac�k'�through�the�history�list,�fetc�hing�the�previous�command.���s��G�next-history��f(C-n)����K�:�Mo��!v�e��f`forw�ard'�through�the�history�list,�fetc�hing�the�next�command.����G�beginning-of-history��f(M-<)����K�:�Mo��!v�e��fto�the�rst�line�in�the�history��e.����G�end-of-history��f(M->)����K�:�Mo��!v�e��fto�the�end�of�the�input�history��e,�i.e.,�the�line�curren��!tly�b�M�eing�en�tered.����G�reverse-search-history��f(C-r)����K�:�Searc��!h��:bac�kw�ard�starting�at�the�curren�t�line�and�mo�ving�`up'�through�the�his-����K�:tory��fas�necessary��e.���This�is�an�incremen��!tal�searc�h.����G�forward-search-history��f(C-s)����K�:�Searc��!h���forw�ard�starting�at�the�curren�t�line�and�mo�ving�`do�wn'�through�the�the����K�:history��fas�necessary��e.���This�is�an�incremen��!tal�searc�h.����G�non-incremental-reverse-search-history��f(M-p)����K�:�Searc��!h��:bac�kw�ard�starting�at�the�curren�t�line�and�mo�ving�`up'�through�the�his-����K�:tory�Ryas�necessary�using�a�non-incremen��!tal�searc�h�for�a�string�supplied�b�y�the����K�:user.����G�non-incremental-forward-search-history��f(M-n)����K�:�Searc��!h���forw�ard�starting�at�the�curren�t�line�and�mo�ving�`do�wn'�through�the�the����K�:history�3�as�necessary�using�a�non-incremen��!tal�searc�h�for�a�string�supplied�b�y�the����K�:user.����G�history-search-forward��f()����K�:�Searc��!h��Oforw�ard�through�the�history�for�the�string�of�c�haracters�b�M�et�w�een�the����K�:start�7�of�the�curren��!t�line�and�the�p�M�oin�t.���This�is�a�non-incremen�tal�searc�h.���By����K�:default,��fthis�command�is�un��!b�M�ound.����G�history-search-backward��f()����K�:�Searc��!h�-�bac�kw�ard�through�the�history�for�the�string�of�c�haracters�b�M�et�w�een�the����K�:start�7�of�the�curren��!t�line�and�the�p�M�oin�t.���This�is�a�non-incremen�tal�searc�h.���By����K�:default,��fthis�command�is�un��!b�M�ound.����G�yank-nth-arg��f(M-C-y)����K�:�Insert�s�the�rst�argumen��!t�to�the�previous�command�(usually�the�second�w�ord����K�:on��|the�previous�line)�at�p�M�oin��!t.�h With�an�argumen�t��n�,��insert�the��n�th�w�ord�from����K�:the�0�previous�command�(the�w��!ords�in�the�previous�command�b�M�egin�with�w�ord����K�:0).�-dA���negativ��!e���argumen�t�inserts�the��n�th�w�ord�from�the�end�of�the�previous����K�:command.��Once��Gthe�argumen��!t��n��is�computed,�
?the�argumen�t�is�extracted�as�if����K�:the��f`�!�n�Ds�'�history�expansion�had�b�M�een�sp�ecied.����G�yank-last-arg��f(M-.�or�M-_)����K�:�Insert�5Elast�argumen��!t�to�the�previous�command�(the�last�w�ord�of�the�previous����K�:history��fen��!try).���With�an�argumen�t,���b�M�eha�v�e�exactly�lik�e��yank-nth-arg�.���Succes-����K�:siv��!e�&�calls�to��yank-last-arg��mo�v�e�bac�k�through�the�history�list,�F�inserting�the����K�:last��eargumen��!t�of�eac�h�line�in�turn.���The�history�expansion�facilities�are�used�to����K�:extract��fthe�last�argumen��!t,�as�if�the�`�!$�'�history�expansion�had�b�M�een�sp�ecied.���� �C��� ���G�Chapter��f1:���Command�Line�Editing� �Ӯ15�����3*�����֍��G�a1.4.3�d(Commands��MF��ģor�Changing�T�ext����G�delete-char��f(C-d)��
33��K�:�Delete���the�c��!haracter�at�p�M�oin�t.��If�p�M�oin�t�is�at�the�b�M�eginning�of�the�line,���there����K�:are�r�no�c��!haracters�in�the�line,���and�the�last�c�haracter�t�yp�M�ed�w�as�not�b�M�ound�to����K�:�delete-char�,��fthen�return��eof�.��C��G�backward-delete-char��f(Rubout)����K�:�Delete���the�c��!haracter�b�M�ehind�the�cursor.�A���n�umeric�argumen�t�means�to�kill�the����K�:c��!haracters��finstead�of�deleting�them.����G�forward-backward-delete-char��f()����K�:�Delete���the�c��!haracter�under�the�cursor,��unless�the�cursor�is�at�the�end�of�the����K�:line,��~in�ͭwhic��!h�case�the�c�haracter�b�M�ehind�the�cursor�is�deleted.�S�By�default,��~this����K�:is��fnot�b�M�ound�to�a�k��!ey��e.����G�quoted-insert��f(C-q�or�C-v)����K�:�Add��the�next�c��!haracter�t�yp�M�ed�to�the�line�v�erbatim.�C�This�is�ho�w�to�insert�k�ey����K�:sequences��flik��!e��C-q�,�for�example.����G�tab-insert��f(M-������h�����̟�@ � ff �l�� ��T��J�AB����̟ٚ� ff �l���8�����i���ь�)����K�:�Insert��fa�tab�c��!haracter.����G�self-insert��f(a,�b,�A,�1,�!,��...���e)����K�:�Insert��fy��!ourself.����G�transpose-chars��f(C-t)����K�:�Drag���the�c��!haracter�b�M�efore�the�cursor�forw�ard�o�v�er�the�c�haracter�at�the�cursor,����K�:mo��!ving�C"the�cursor�forw�ard�as�w�ell.��If�the�insertion�p�M�oin�t�is�at�the�end�of�the����K�:line,���then���this�transp�M�oses�the�last�t��!w�o���c�haracters�of�the�line.���Negativ�e�argumen�ts����K�:ha��!v�e��fno�eect.����G�transpose-words��f(M-t)����K�:�Drag���the�w��!ord�b�M�efore�p�oin��!t�past�the�w�ord�after�p�M�oin�t,��mo�ving�p�M�oin�t�past�that����K�:w��!ord�g�as�w�ell.���If�the�insertion�p�M�oin�t�is�at�the�end�of�the�line,�tAthis�transp�M�oses�the����K�:last��ft��!w�o�w�ords�on�the�line.����G�upcase-word��f(M-u)����K�:�Upp�M�ercase���the�curren��!t�(or�follo�wing)�w�ord.�o#With�a�negativ�e�argumen�t,���upp�M�er-����K�:case��fthe�previous�w��!ord,�but�do�not�mo�v�e�the�cursor.����G�downcase-word��f(M-l)����K�:�Lo��!w�ercase���the�curren��!t�(or�follo�wing)�w�ord.���With�a�negativ�e�argumen�t,�˖lo�w�ercase����K�:the��fprevious�w��!ord,�but�do�not�mo�v�e�the�cursor.����G�capitalize-word��f(M-c)����K�:�Capitalize��6the�curren��!t�(or�follo�wing)�w�ord.��#With�a�negativ�e�argumen�t,��rcapitalize����K�:the��fprevious�w��!ord,�but�do�not�mo�v�e�the�cursor.����G�overwrite-mode��f()����K�:�T��eoggle��o��!v�erwrite�mo�M�de.�� With�an�explicit�p�ositiv��!e�n�umeric�argumen�t,�
switc�hes����K�:to���o��!v�erwrite�mo�M�de.��fWith�an�explicit�non-p�ositiv��!e�n�umeric�argumen�t,�Ϯswitc�hes�to���� ᑍ�� ���G�16�9pGNU��fReadline�Library�����3*�����֍�K�:insert���mo�M�de.��=This�command�aects�only��emacs��mo�de;���vi��mo�de�do�es�o��!v�erwrite��
33��K�:dieren��!tly��e.���Eac�h��fcall�to��readline()��starts�in�insert�mo�M�de.�����K�:In���o��!v�erwrite�mo�M�de,��c�haracters�b�M�ound�to��self-insert��replace�the�text�at�p�oin��!t����K�:rather���than�pushing�the�text�to�the�righ��!t.��tCharacters�b�M�ound�to��backward-����K�:delete-char��f�replace�the�c��!haracter�b�M�efore�p�oin��!t�with�a�space.����K�:By��fdefault,�this�command�is�un��!b�M�ound.��p����G�a1.4.4�d(Killing��MAnd�Y��ģanking����G��G�kill-line��f(C-k)����K�:�Kill��fthe�text�from�p�M�oin��!t�to�the�end�of�the�line.��(���G�backward-kill-line��f(C-x�Rubout)����K�:�Kill��fbac��!kw�ard�to�the�b�M�eginning�of�the�line.����G�unix-line-discard��f(C-u)����K�:�Kill��fbac��!kw�ard�from�the�cursor�to�the�b�M�eginning�of�the�curren�t�line.����G�kill-whole-line��f()����K�:�Kill�cjall�c��!haracters�on�the�curren�t�line,���no�matter�where�p�M�oin�t�is.��By�default,����K�:this��fis�un��!b�M�ound.����G�kill-word��f(M-d)����K�:�Kill��from�p�M�oin��!t�to�the�end�of�the�curren�t�w�ord,��Qor�if�b�M�et�w�een�w�ords,��Qto�the�end����K�:of��fthe�next�w��!ord.���W��eord�b�M�oundaries�are�the�same�as��forward-word�.����G�backward-kill-word��f(M-������h�����̟�@ � ff ���� ��DEL����̟ٚ� ff ������8����i�����)����K�:�Kill�w�the�w��!ord�b�M�ehind�p�oin��!t.��XW��eord�b�oundaries�are�the�same�as��backward-word�.����G�unix-word-rubout��f(C-w)����K�:�Kill��Lthe�w��!ord�b�M�ehind�p�oin��!t,��using�white�space�as�a�w�ord�b�M�oundary��e.�R�The�killed����K�:text��fis�sa��!v�ed��fon�the�kill-ring.����G�unix-filename-rubout��f()����K�:�Kill�]�the�w��!ord�b�M�ehind�p�oin��!t,���using�white�space�and�the�slash�c�haracter�as�the����K�:w��!ord��fb�M�oundaries.���The�killed�text�is�sa�v�ed�on�the�kill-ring.����G�delete-horizontal-space��f()����K�:�Delete��fall�spaces�and�tabs�around�p�M�oin��!t.���By�default,�this�is�un�b�M�ound.����G�kill-region��f()����K�:�Kill��fthe�text�in�the�curren��!t�region.���By�default,�this�command�is�un�b�M�ound.����G�copy-region-as-kill��f()����K�:�Cop��!y��the�text�in�the�region�to�the�kill�buer,�0Eso�it�can�b�M�e�y�ank�ed�righ�t�a�w�a�y��e.����K�:By��fdefault,�this�command�is�un��!b�M�ound.����G�copy-backward-word��f()����K�:�Cop��!y��the�w�ord�b�M�efore�p�oin��!t�to�the�kill�buer.���The�w�ord�b�M�oundaries�are�the����K�:same��fas��backward-word�.���By�default,�this�command�is�un��!b�M�ound.����G�copy-forward-word��f()����K�:�Cop��!y��8the�w�ord�follo�wing�p�M�oin�t�to�the�kill�buer.�SThe�w�ord�b�M�oundaries�are�the����K�:same��fas��forward-word�.���By�default,�this�command�is�un��!b�M�ound.���� 쫍�� ���G�Chapter��f1:���Command�Line�Editing� �Ӯ17�����3*�����֍�G�yank��f(C-y)��
33��K�:�Y��eank��fthe�top�of�the�kill�ring�in��!to�the�buer�at�p�M�oin�t.��FӍ�G�yank-pop��f(M-y)����K�:�Rotate�'!the�kill-ring,�GPand�y��!ank�the�new�top.�`Y��eou�can�only�do�this�if�the�prior����K�:command��fis��yank��or��yank-pop�.��p���G�a1.4.5�d(Sp�iecifying��MNumeric�Argumen���ts���p6��G�digit-argument��f(�M-0�,��M-1�,��...�����M--�)����K�:�Add�:Lthis�digit�to�the�argumen��!t�already�accum�ulating,�O�or�start�a�new�argumen�t.����K�:�M--��f�starts�a�negativ��!e�argumen�t.����G�universal-argument��f()����K�:�This�kis�another�w��!a�y�kto�sp�M�ecify�an�argumen��!t.���If�this�command�is�follo�w�ed�b�y�one����K�:or��more�digits,���optionally�with�a�leading�min��!us�sign,�those�digits�dene�the�ar-����K�:gumen��!t.���If�\the�command�is�follo�w�ed�b�y�digits,��+executing��universal-argument����K�:�again�ѫends�the�n��!umeric�argumen�t,��|but�is�otherwise�ignored.�_�As�a�sp�M�ecial�case,����K�:if���this�command�is�immediately�follo��!w�ed���b�y�a�c�haracter�that�is�neither�a�digit����K�:or�Zwmin��!us�sign,�i�the�argumen�t�coun�t�for�the�next�command�is�m�ultiplied�b�y�four.����K�:The�{targumen��!t�coun�t�is�initially�one,���so�executing�this�function�the�rst�time����K�:mak��!es��2the�argumen�t�coun�t�four,��ea�second�time�mak�es�the�argumen�t�coun�t�six-����K�:teen,��fand�so�on.���By�default,�this�is�not�b�M�ound�to�a�k��!ey��e.��p���G�a1.4.6�d(Letting��MReadline�T���yp�ie�F��ģor�Y�ou���p6��G�complete��f(������h�����̟�@ � ff �l�� ��T��J�AB����̟ٚ� ff �l���8�����i���ь�)����K�:�A��!ttempt���to�p�M�erform�completion�on�the�text�b�efore�p�oin��!t.��The�actual�completion����K�:p�M�erformed��fis�application-sp�ecic.���The�default�is�lename�completion.����G�possible-completions��f(M-?)����K�:�List��fthe�p�M�ossible�completions�of�the�text�b�efore�p�oin��!t.����G�insert-completions��f(M-*)����K�:�Insert���all�completions�of�the�text�b�M�efore�p�oin��!t�that�w�ould�ha�v�e�b�M�een�generated����K�:b��!y��f�possible-completions�.����G�menu-complete��f()����K�:�Similar��Vto��complete�,��but�replaces�the�w��!ord�to�b�M�e�completed�with�a�single�matc�h����K�:from���the�list�of�p�M�ossible�completions.��^Rep�eated�execution�of��menu-complete����K�:�steps�կthrough�the�list�of�p�M�ossible�completions,�!�inserting�eac��!h�matc�h�in�turn.����K�:A��!t�j�the�end�of�the�list�of�completions,���the�b�M�ell�is�rung�(sub� ��ject�to�the�setting����K�:of�Th�bell-style�)�and�the�original�text�is�restored.���An�argumen��!t�of��n��mo�v�es��n����K�:�p�M�ositions�,Rforw��!ard�in�the�list�of�matc�hes;�oGa�negativ�e�argumen�t�ma�y�b�M�e�used�to����K�:mo��!v�e���bac�kw�ard�through�the�list.��UThis�command�is�in�tended�to�b�M�e�b�ound�to������K�:����h����N���@ � ff �l�� ��T��J�AB���N��ٚ� ff �l���`䞙��i���c���,��fbut�is�un��!b�M�ound�b�y�default.����G�delete-char-or-list��f()����K�:�Deletes�9{the�c��!haracter�under�the�cursor�if�not�at�the�b�M�eginning�or�end�of�the�line����K�:(lik��!e�~��delete-char�).�СIf�at�the�end�of�the�line,���b�M�eha�v�es�iden�tically�to��possible-����K�:completions�.���This��fcommand�is�un��!b�M�ound�b�y�default.���� �፟� ���G�18�9pGNU��fReadline�Library�����3*�����֍��G�a1.4.7�d(Keyb�ioard��MMacros�������G�start-kbd-macro��f(C-x�()��
33��K�:�Begin��fsa��!ving�the�c�haracters�t�yp�M�ed�in�to�the�curren�t�k�eyb�M�oard�macro.���㍑G�end-kbd-macro��f(C-x�))����K�:�Stop�G!sa��!ving�the�c�haracters�t�yp�M�ed�in�to�the�curren�t�k�eyb�M�oard�macro�and�sa�v�e�the����K�:denition.����G�call-last-kbd-macro��f(C-x�e)����K�:�Re-execute�9Bthe�last�k��!eyb�M�oard�macro�dened,�]�b�y�making�the�c�haracters�in�the����K�:macro��fapp�M�ear�as�if�t��!yp�ed�at�the�k��!eyb�oard.���_���G�a1.4.8�d(Some��MMiscellaneous�Commands�������G�re-read-init-file��f(C-x�C-r)����K�:�Read��kin�the�con��!ten�ts��kof�the��inputrc�Jo�le,���and�incorp�M�orate�an��!y�bindings�or�v��dDariable����K�:assignmen��!ts��ffound�there.����G�abort��f(C-g)����K�:�Ab�M�ort�/the�curren��!t�editing�command�and�ring�the�terminal's�b�ell�(sub� ��ject�to�the����K�:setting��fof��bell-style�).����G�do-uppercase-version��f(M-a,�M-b,�M-�x�,��...���e)����K�:�If�Q�the�metaed�c��!haracter��x�T�is�lo�w�ercase,�b�run�the�command�that�is�b�M�ound�to�the����K�:corresp�M�onding��fupp�ercase�c��!haracter.����G�prefix-meta��f(������h�����̟�@ � ff �T�� ��ESC����̟ٚ� ff �T��������i����t�)����K�:�Metafy��2the�next�c��!haracter�t�yp�M�ed.�q@This�is�for�k�eyb�M�oards�without�a�meta�k�ey��e.����K�:T��!yping��f`������h�����̟�@ � ff �T�� ��ESC����̟ٚ� ff �T��������i���K��f�'�is�equiv��dDalen�t�to�t�yping��M-f�.����G�undo��f(C-_�or�C-x�C-u)����K�:�Incremen��!tal��fundo,�separately�remem�b�M�ered�for�eac�h�line.����G�revert-line��f(M-r)����K�:�Undo��all�c��!hanges�made�to�this�line.���This�is�lik�e�executing�the��undo��command����K�:enough��ftimes�to�get�bac��!k�to�the�b�M�eginning.����G�tilde-expand��f(M-~)����K�:�P��!erform��ftilde�expansion�on�the�curren�t�w�ord.����G�set-mark��f(C-@)����K�:�Set��the�mark�to�the�p�M�oin��!t.���If�a�n�umeric�argumen�t�is�supplied,�ythe�mark�is�set����K�:to��fthat�p�M�osition.����G�exchange-point-and-mark��f(C-x�C-x)����K�:�Sw��!ap���the�p�M�oin�t�with�the�mark.�'!The�curren�t�cursor�p�M�osition�is�set�to�the�sa�v�ed����K�:p�M�osition,��fand�the�old�cursor�p�osition�is�sa��!v�ed��fas�the�mark.����G�character-search��f(C-])����K�:�A��&c��!haracter��Qis�read�and�p�M�oin�t�is�mo�v�ed�to�the�next�o�M�ccurrence�of�that�c�haracter.����K�:A��fnegativ��!e�coun�t�searc�hes�for�previous�o�M�ccurrences.���� 䍟� ���G�Chapter��f1:���Command�Line�Editing� �Ӯ19�����3*�����֍�G�character-search-backward��f(M-C-])��
33��K�:�A�c"c��!haracter�c�is�read�and�p�M�oin�t�is�mo�v�ed�to�the�previous�o�M�ccurrence�of�that����K�:c��!haracter.���A��fnegativ�e�coun�t�searc�hes�for�subsequen�t�o�M�ccurrences.��33��G�insert-comment��f(M-#)����K�:�Without�G�a�n��!umeric�argumen�t,�p+the�v��dDalue�of�the��comment-begin��v�ariable�is�in-����K�:serted���at�the�b�M�eginning�of�the�curren��!t�line.�QdIf�a�n�umeric�argumen�t�is�supplied,����K�:this�c�command�acts�as�a�toggle:�Yif�the�c��!haracters�at�the�b�M�eginning�of�the�line����K�:do���not�matc��!h�the�v��dDalue�of��comment-begin�,��Ythe�v�alue�is�inserted,��Yotherwise�the����K�:c��!haracters��6in��comment-begin��are�deleted�from�the�b�M�eginning�of�the�line.�dMIn����K�:either��fcase,�the�line�is�accepted�as�if�a�newline�had�b�M�een�t��!yp�ed.����G�dump-functions��f()����K�:�Prin��!t�,Qall�of�the�functions�and�their�k�ey�bindings�to�the�Readline�output�stream.����K�:If���a�n��!umeric�argumen�t�is�supplied,��the�output�is�formatted�in�suc�h�a�w�a�y�that����K�:it��fcan�b�M�e�made�part�of�an��inputrc�Pj�le.���This�command�is�un��!b�ound�b��!y�default.����G�dump-variables��f()����K�:�Prin��!t���all�of�the�settable�v��dDariables�and�their�v�alues�to�the�Readline�output�stream.����K�:If���a�n��!umeric�argumen�t�is�supplied,��the�output�is�formatted�in�suc�h�a�w�a�y�that����K�:it��fcan�b�M�e�made�part�of�an��inputrc�Pj�le.���This�command�is�un��!b�ound�b��!y�default.����G�dump-macros��f()����K�:�Prin��!t�
�all�of�the�Readline�k�ey�sequences�b�M�ound�to�macros�and�the�strings�they����K�:output.�r�If�-Ja�n��!umeric�argumen�t�is�supplied,�Othe�output�is�formatted�in�suc�h�a����K�:w��!a�y��that�it�can�b�M�e�made�part�of�an��inputrc�D�le.���This�command�is�un��!b�ound�b��!y����K�:default.����G�emacs-editing-mode��f(C-e)����K�:�When��fin��vi��command�mo�M�de,�this�causes�a�switc��!h�to��emacs��editing�mo�de.����G�vi-editing-mode��f(M-C-j)����K�:�When��fin��emacs��editing�mo�M�de,�this�causes�a�switc��!h�to��vi��editing�mo�de.�� ���G�X1.5��Readline�f@vi�Mo�s3de���ff��!G�While��Uthe�Readline�library�do�M�es�not�ha��!v�e��Ua�full�set�of��vi��editing�functions,� �it�do�es�con��!tain����Genough��to�allo��!w�simple�editing�of�the�line.�.�The�Readline��vi��mo�M�de�b�eha��!v�es��as�sp�ecied�in����Gthe��f�posix��1003.2�standard.��33��!GIn�|Uorder�to�switc��!h�in�teractiv�ely�b�M�et�w�een��emacs��and��vi��editing�mo�M�des,���use�the�command����G�M-C-j��i�(b�M�ound�to�emacs-editing-mo�de�when�in��vi��mo�de�and�to�vi-editing-mo�de�in��emacs����G�mo�M�de).���The��fReadline�default�is��emacs��mo�de.����!GWhen���y��!ou�en�ter�a�line�in��vi��mo�M�de,���y�ou�are�already�placed�in�`insertion'�mo�M�de,���as�if�y�ou����Ghad�&Gt��!yp�M�ed�an�`�i�'.��(Pressing�������h������@ � ff �T�� ��ESC����ٚ� ff �T���2ٞ���i�����switc�hes�y�ou�in�to�`command'�mo�M�de,�?�where�y�ou�can�edit�the����Gtext�of�the�line�with�the�standard��vi��mo��!v�emen�t�k�eys,�)<mo�v�e�to�previous�history�lines�with����G`�k�'��fand�subsequen��!t�lines�with�`�j�',�and�so�forth.���� ۍ�� ���G�20�9pGNU��fReadline�Library�����3*�� ���� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ21�����3*�����֍��G�O2� �QProgramming�z�with�GNU�Readline���� ��!G�This�
c��!hapter�describ�M�es�the�in�terface�b�M�et�w�een�the��gnu��Readline�Library�and�other�pro-��
33��Ggrams.���If���y��!ou�are�a�programmer,��and�y�ou�wish�to�include�the�features�found�in��gnu��Readline����Gsuc��!h���as�completion,��line�editing,�and�in��!teractiv�e���history�manipulation�in�y��!our�o�wn�programs,����Gthis��fsection�is�for�y��!ou.���{���G�X2.1��Basic�f@Beha���vior���B���!G�Man��!y���programs�pro�vide�a�command�line�in�terface,��tsuc�h�as��mail�,��t�ftp�,�and����sh�.��1F��eor�suc�h����Gprograms,�x�the�mFdefault�b�M�eha��!viour�of�Readline�is�sucien�t.���This�section�describ�M�es�ho�w�to�use����GReadline�!tin�the�simplest�w��!a�y�!tp�M�ossible,�@8p�erhaps�to�replace�calls�in�y��!our�co�de�to��gets()��or����G�fgets()�.��\��!GThe���function��readline()��prin��!ts�a�prompt��prompt�%��and�then�reads�and�returns�a�single����Gline��of�text�from�the�user.���If��prompt�*��is��NULL��or�the�empt��!y�string,��xno�prompt�is�displa�y�ed.����GThe�u}line��readline��returns�is�allo�M�cated�with��malloc()�;��the�caller�should��free()��the�line����Gwhen��fit�has�nished�with�it.���The�declaration�for��readline��in�ANSI�C�is����.���char���*readline�(const�char�*�prompt�Ds�);����G�So,��fone�migh��!t�sa�y����.���char���*line�=�readline�("Enter�a�line:�");����G�in���order�to�read�a�line�of�text�from�the�user.���The�line�returned�has�the�nal�newline�remo��!v�ed,����Gso��fonly�the�text�remains.����!GIf����readline��encoun��!ters�an��EOF��while�reading�the�line,�*^and�the�line�is�empt�y�at�that����Gp�M�oin��!t,��^then���(char��f*)NULL��is�returned.��oOtherwise,�the�line�is�ended�just�as�if�a�newline�had����Gb�M�een��ft��!yp�ed.����!GIf�~y��!ou�w�an�t�the�user�to�b�M�e�able�to�get�at�the�line�later,�7F(with�������h����J��@ � ff
�ԟ� ��C-p���J�ٚ� ff
�Ԏ��5�����i������for�example),�y��!ou�m�ust����Gcall��f�add_history()��to�sa��!v�e��fthe�line�a��!w�a�y��fin�a��history��~�list�of�suc��!h�lines.����.���add_history���(line);����G�F��eor��ffull�details�on�the�GNU�History�Library�,�see�the�asso�M�ciated�man��!ual.����!GIt�Íis�preferable�to�a��!v�oid�Ísa�ving�empt�y�lines�on�the�history�list,���since�users�rarely�ha�v�e�a����Gburning��4need�to�reuse�a�blank�line.���Here�is�a�function�whic��!h�usefully�replaces�the�standard����G�gets()��f�library�function,�and�has�the�adv��dDan��!tage�of�no�static�buer�to�o�v�er
o�w:����.���/*���A�static�variable�for�holding�the�line.�*/����.��static���char�*line_read�=�(char�*)NULL;��ff��.��/*���Read�a�string,�and�return�a�pointer�to�it.����@8�Returns���NULL�on�EOF.�*/����.��char���*����.��rl_gets���()����.��{����:x�/*���If�the�buffer�has�already�been�allocated,����K��return���the�memory�to�the�free�pool.�*/����:x�if���(line_read)����E�D{���� ��� ���G�22�9pGNU��fReadline�Library�����3*�����֍�Qw��free���(line_read);��
33��Qw�line_read���=�(char�*)NULL;����E�D}��ff��:x�/*���Get�a�line�from�the�user.�*/����:x�line_read���=�readline�("");����:x�/*���If�the�line�has�any�text�in�it,����K��save���it�on�the�history.�*/����:x�if���(line_read�&&�*line_read)����E�Dadd_history���(line_read);����:x�return���(line_read);����.��}���D��!G�This���function�giv��!es�the�user�the�default�b�M�eha�viour�of�������h����Ĺ��@ � ff �l�� ��T��J�AB���Ĺ�ٚ� ff �l��������i����f�completion:�w�completion�on�le����Gnames.���If��y��!ou�do�not�w�an�t�Readline�to�complete�on�lenames,���y�ou�can�c�hange�the�binding����Gof��fthe�������h�����2��@ � ff �l�� ��T��J�AB����2�ٚ� ff �l��������i���X�k��!ey�with��rl_bind_key()�.����.���int���rl_bind_key�(int��key�,�rl_command_func_t�*�function�Ds�);����!Grl_bind_key()���tak��!es�t�w�o�argumen�ts:��?�k�ey����is�the�c�haracter�that�y�ou�w�an�t�to�bind,��and����G�function�Mj�is�the�address�of�the�function�to�call�when��k��!ey�=��is�pressed.���Binding�������h����86��@ � ff �l�� ��T��J�AB���86�ٚ� ff �l��������i��� l`�to��rl_����Ginsert()�7L�mak��!es�������h����"��@ � ff �l�� ��T��J�AB���"�ٚ� ff �l���o�����i��� @$�insert�itself.����rl_bind_key()��returns�non-zero�if��k�ey�'d�is�not�a�v��dDalid����GASCI�M�I��fc��!haracter�co�de�(b�et��!w�een��f0�and�255).����!GTh��!us,��fto�disable�the�default�������h�����2��@ � ff �l�� ��T��J�AB����2�ٚ� ff �l��������i���X�b�M�eha�vior,�the�follo�wing�suces:����.���rl_bind_key���('\t',�rl_insert);����!G�This�+co�M�de�should�b�e�executed�once�at�the�start�of�y��!our�program;�T,y�ou�migh�t�write�a�func-����Gtion���called��initialize_readline()��whic��!h�p�M�erforms�this�and�other�desired�initializations,����Gsuc��!h��fas�installing�custom�completers�(see�Section�2.6�[Custom�Completers],�page�41).���3���G�X2.2��Custom�f@F���functions����w��!G�Readline��}pro��!vides�man�y�functions�for�manipulating�the�text�of�the�line,�but�it�isn't�p�M�ossi-����Gble�)jto�an��!ticipate�the�needs�of�all�programs.��4This�section�describ�M�es�the�v��dDarious�functions�and����Gv��dDariables�"dened�within�the�Readline�library�whic��!h�allo�w�a�user�program�to�add�customized����Gfunctionalit��!y��fto�Readline.����!GBefore�a�declaring�an��!y�functions�that�customize�Readline's�b�M�eha�vior,���or�using�an�y�func-����Gtionalit��!y�xQReadline�pro�vides�in�other�co�M�de,���an�application�writer�should�include�the�le����G�<readline/readline.h>���in�an��!y�le�that�uses�Readline's�features.��?Since�some�of�the�de-����Gnitions���in��readline.h��use�the��stdio��library��e,�Čthe�le��<stdio.h>��should�b�M�e�included�b�efore����G�readline.h�.����!G�readline.h��2�denes�a�C��1prepro�M�cessor�v��dDariable�that�should�b�e�treated�as�an�in��!teger,����RL_����GREADLINE_VERSION�,��whic��!h��(ma�y�b�M�e�used�to�conditionally�compile�application�co�de�dep�ending����Gon�4�the�installed�Readline�v��!ersion.���The�v��dDalue�is�a�hexadecimal�enco�M�ding�of�the�ma� ��jor�and����Gminor�Rv��!ersion�n�um�b�M�ers�of�the�library��e,�8�of�the�form�0x�MMmm�.�<��MM�J��is�the�t�w�o-digit�ma� ��jor����Gv��!ersion�z.n�um�b�M�er;����mm��is�the�t�w�o-digit�minor�v�ersion�n�um�b�M�er.�� F��eor�Readline�4.2,��for�example,����Gthe��fv��dDalue�of��RL_READLINE_VERSION��w��!ould�b�M�e��0x0402�.���� 'ꍟ� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ23�����3*�����֍��G�a2.2.1�d(Readline��MT���yp�iedefs�����!G�F��eor��freadabilt��!y�,�w��!e�declare�a�n�um�b�M�er�of�new�ob� ��ject�t�yp�M�es,�all�p�oin��!ters�to�functions.���ލ�!GThe�I�reason�for�declaring�these�new�t��!yp�M�es�is�to�mak�e�it�easier�to�write�co�M�de�describing��
33��Gp�M�oin��!ters��fto�C�functions�with�appropriately�protot�yp�M�ed�argumen�ts�and�return�v��dDalues.����!GF��eor�m�instance,���sa��!y�w�e�w�an�t�to�declare�a�v��dDariable��func���as�a�p�M�oin�ter�to�a�function�whic�h����Gtak��!es��t�w�o��int��argumen�ts�and�returns�an��int��(this�is�the�t�yp�M�e�of�all�of�the�Readline�bindable����Gfunctions).���Instead��fof�the�classic�C�declaration����!G�int��f(*func)();����G�or��fthe�ANSI-C�st��!yle�declaration����!G�int��f(*func)(int,�int);����G�w��!e��fma�y�write����!G�rl_command_func_t��f*func;����!G�The��ffull�list�of�function�p�M�oin��!ter�t�yp�M�es�a�v��dDailable�is������G�typedef��fint�rl_command_func_t�(int,�int);����Gtypedef��fchar�*rl_compentry_func_t�(const�char�*,�int);����Gtypedef��fchar�**rl_completion_func_t�(const�char�*,�int,�int);����Gtypedef��fchar�*rl_quote_func_t�(char�*,�int,�char�*);����Gtypedef��fchar�*rl_dequote_func_t�(char�*,�int);����Gtypedef��fint�rl_compignore_func_t�(char�**);����Gtypedef��fvoid�rl_compdisp_func_t�(char�**,�int,�int);����Gtypedef��fint�rl_hook_func_t�(void);����Gtypedef��fint�rl_getc_func_t�(FILE�*);����Gtypedef��fint�rl_linebuf_func_t�(char�*,�int);����Gtypedef��fint�rl_intfunc_t�(int);����G#define��frl_ivoidfunc_t�rl_hook_func_t����Gtypedef��fint�rl_icpfunc_t�(char�*);����Gtypedef��fint�rl_icppfunc_t�(char�**);����Gtypedef��fvoid�rl_voidfunc_t�(void);����Gtypedef��fvoid�rl_vintfunc_t�(int);����Gtypedef��fvoid�rl_vcpfunc_t�(char�*);����Gtypedef��fvoid�rl_vcppfunc_t�(char�**);��UU���G�a2.2.2�d(W��ģriting��Ma�New�F�unction�����!G�In���order�to�write�new�functions�for�Readline,��y��!ou�need�to�kno�w�the�calling�con�v�en�tions����Gfor�l�k��!eyb�M�oard-in�v�ok�ed�functions,��Jand�the�names�of�the�v��dDariables�that�describ�M�e�the�curren�t����Gstate��fof�the�line�read�so�far.����!GThe��fcalling�sequence�for�a�command��foo��lo�M�oks�lik��!e����.���int���foo�(int�count,�int�key)����G�where�Pg�coun��!t��g�is�the�n�umeric�argumen�t�(or�1�if�defaulted)�and��k�ey�@�is�the�k�ey�that�in�v�ok�ed����Gthis��ffunction.����!GIt��is�completely�up�to�the�function�as�to�what�should�b�M�e�done�with�the�n��!umeric�argumen�t.����GSome��;functions�use�it�as�a�rep�M�eat�coun��!t,�psome�as�a�
ag,�and�others�to�c��!ho�M�ose�alternate���� 5���� ���G�24�9pGNU��fReadline�Library�����3*�����֍�Gb�M�eha��!vior�4�(refreshing�the�curren�t�line�as�opp�M�osed�to�refreshing�the�screen,���for�example).��
33��GSome��c��!ho�M�ose�to�ignore�it.��In�general,��if�a�function�uses�the�n�umeric�argumen�t�as�a�rep�M�eat����Gcoun��!t,�itit�Z7should�b�M�e�able�to�do�something�useful�with�b�oth�negativ��!e�and�p�ositiv��!e�argumen�ts.����GA��!t��fthe�v�ery�least,�it�should�b�M�e�a�w�are�that�it�can�b�M�e�passed�a�negativ�e�argumen�t.��� ��!GA�U�command�Vfunction�should�return�0�if�its�action�completes�successfully��e,�fand�a�non-zero����Gv��dDalue��.if�some�error�o�M�ccurs.�4This�is�the�con��!v�en�tion��.ob�ey�ed��.b�y�all�of�the�builtin�Readline����Gbindable��fcommand�functions.���f���G�X2.3��Readline�f@V���fariables���3��!G�These��fv��dDariables�are�a��!v�ailable�to�function�writers.�� ������3[V��eariable]���G�=��<x
cmtt10�char���*��<�"V
cmbx10�rl�� �R� �� #؎�|line�� �R� �� #؎�buer����.���This��is�the�line�gathered�so�far.�$�Y��eou�are�w��!elcome�to�mo�M�dify�the�con�ten�ts�of�the�line,����.��but�Dqsee�Section�2.4.5�[Allo��!wing�Undoing],�k�page�32.���The�function��rl_extend_line_����.��buffer��f�is�a��!v��dDailable�to�increase�the�memory�allo�M�cated�to��rl_line_buffer�.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|p�b"oin���t����.���The��foset�of�the�curren��!t�cursor�p�M�osition�in��rl_line_buffer��(the��p��p�oint� ��).�������3[V��eariable]���G�int����rl�� �R� �� #؎�|end����.���The�Y6n��!um�b�M�er�of�c�haracters�presen�t�in��rl_line_buffer�.��"When��rl_point��is�at�the�end����.��of��fthe�line,��rl_point��and��rl_end��are�equal.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|mark����.���The�n��mark���(sa��!v�ed�p�M�osition)�in�the�curren�t�line.�6�If�set,���the�mark�and�p�M�oin�t�dene�a����.���r��p�e�gion�.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|done����.���Setting���this�to�a�non-zero�v��dDalue�causes�Readline�to�return�the�curren��!t�line�immediately��e.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|n���um�� �R� �� #؎�c�hars�� �R� �� #؎�to�� �R� �� #؎�read����.���Setting��this�to�a�p�M�ositiv��!e�v��dDalue�b�efore�calling��readline()��causes�Readline�to�return����.��after�H�accepting�that�man��!y�c�haracters,�q}rather�than�reading�up�to�a�c�haracter�b�M�ound����.��to��f�accept-line�.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|p�b"ending�� �R� �� #؎�input����.���Setting�this�to�a�v��dDalue�mak��!es�it�the�next�k�eystrok�e�read.���This�is�a�w�a�y�to�stu�a�single����.��c��!haracter��fin�to�the�input�stream.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|dispatc���hing����.���Set��Wto�a�non-zero�v��dDalue�if�a�function�is�b�M�eing�called�from�a�k��!ey�binding;�'�zero�otherwise.����.��Application�JOfunctions�can�test�this�to�disco��!v�er�JOwhether�they�w��!ere�called�directly�or����.��b��!y��fReadline's�dispatc�hing�mec�hanism.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|erase�� �R� �� #؎�empt���y�� �R� �� #؎�line����.���Setting���this�to�a�non-zero�v��dDalue�causes�Readline�to�completely�erase�the�curren��!t����.��line,�L[including���an��!y�prompt,�an��!y�time�a�newline�is�t�yp�M�ed�as�the�only�c�haracter�on����.��an�\
otherwise-empt��!y�line.���The�cursor�is�mo�v�ed�to�the�b�M�eginning�of�the�newly-blank����.��line.���� @���� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ25�����3*�����֍����3[V��eariable]���G�char���*��rl�� �R� �� #؎�|prompt��
33��.���The�#=prompt�Readline�uses.��%This�is�set�from�the�argumen��!t�to��readline()�,�=yand�should����.��not�:^b�M�e�assigned�to�directly��e.���The��rl_set_prompt()��function�(see�Section�2.4.6�[Redis-����.��pla��!y],��fpage�32)�ma�y�b�M�e�used�to�mo�dify�the�prompt�string�after�calling��readline()�.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|already�� �R� �� #؎�prompted����.���If�\Xan�application�wishes�to�displa��!y�the�prompt�itself,���rather�than�ha�v�e�Readline�do����.��it��9the�rst�time��readline()��is�called,�nit�should�set�this�v��dDariable�to�a�non-zero�v�alue����.��after���displa��!ying�the�prompt.��The�prompt�m�ust�also�b�M�e�passed�as�the�argumen�t�to����.���readline()�� �so�the�redispla��!y�functions�can�up�M�date�the�displa�y�prop�M�erly��e.���The�calling����.��application��fis�resp�M�onsible�for�managing�the�v��dDalue;�Readline�nev��!er�sets�it.�������3[V��eariable]���G�const���char�*��rl�� �R� �� #؎�|library�� �R� �� #؎�v���ersion����.���The��fv��!ersion�n�um�b�M�er�of�this�revision�of�the�library��e.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|readline�� �R� �� #؎�v���ersion����.���An��in��!teger�enco�M�ding�the�curren�t�v�ersion�of�the�library��e.�4bThe�enco�M�ding�is�of�the�form����.��0x�MMmm�,���where�b��MM��I�is�the�t��!w�o-digit�b�ma� ��jor�v��!ersion�n�um�b�M�er,���and��mm��is�the�t�w�o-����.��digit�{�minor�v��!ersion�n�um�b�M�er.�]�F��eor�example,��
for�Readline-4.2,��rl_readline_version����.���w��!ould��fha�v�e�the�v��dDalue�0x0402.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|gn���u�� �R� �� #؎�readline�� �R� �� #؎�p����.���Alw��!a�ys��fset�to�1,�denoting�that�this�is��gnu��readline�rather�than�some�em��!ulation.�������3[V��eariable]���G�const���char�*��rl�� �R� �� #؎�|terminal�� �R� �� #؎�name����.���The�_terminal�t��!yp�M�e,�mJused�for�initialization.��If�not�set�b�y�the�application,�mJReadline�sets����.��this��fto�the�v��dDalue�of�the��TERM��en��!vironmen�t��fv�ariable�the�rst�time�it�is�called.�������3[V��eariable]���G�const���char�*��rl�� �R� �� #؎�|readline�� �R� �� #؎�name����.���This���v��dDariable�is�set�to�a�unique�name�b��!y�eac�h�application�using�Readline.�)4The�v��dDalue����.��allo��!ws�]wconditional�parsing�of�the�inputrc�le�(see�Section�1.3.2�[Conditional�Init�Con-����.��structs],��fpage�9).�������3[V��eariable]���G�FILE���*��rl�� �R� �� #؎�|instream����.���The��stdio�stream�from�whic��!h�Readline�reads�input.��+If��NULL�,�?FReadline�defaults�to����.���stdin�.�������3[V��eariable]���G�FILE���*��rl�� �R� �� #؎�|outstream����.���The�#Rstdio�stream�to�whic��!h�Readline�p�M�erforms�output.�T�If��NULL�,�B�Readline�defaults�to����.���stdout�.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|prefer�� �R� �� #؎�en���v�� �R� �� #؎�winsize����.���If�h non-zero,�t�Readline�giv��!es�v��dDalues�found�in�the��LINES��and��COLUMNS��en�vironmen�t�v��dDari-����.��ables��greater�precedence�than�v��dDalues�fetc��!hed�from�the�k�ernel�when�computing�the����.��screen��fdimensions.�������3[V��eariable]���G�rl_command_func_t���*��rl�� �R� �� #؎�|last�� �R� �� #؎�func����.���The�-)address�of�the�last�command�function�Readline�executed.�r&Ma��!y�b�M�e�used�to�test����.��whether��for�not�a�function�is�b�M�eing�executed�t��!wice�in�succession,�for�example.���� NP��� ���G�26�9pGNU��fReadline�Library�����3*�����֍����3[V��eariable]���G�rl_hook_func_t���*��rl�� �R� �� #؎�|startup�� �R� �� #؎�ho�b"ok��
33��.���If��non-zero,�>this�is�the�address�of�a�function�to�call�just�b�M�efore��readline��prin��!ts�the����.��rst��fprompt.��p������3[V��eariable]���G�rl_hook_func_t���*��rl�� �R� �� #؎�|pre�� �R� �� #؎�input�� �R� �� #؎�ho�b"ok����.���If�C�non-zero,�k9this�is�the�address�of�a�function�to�call�after�the�rst�prompt�has�b�M�een����.��prin��!ted��fand�just�b�M�efore��readline��starts�reading�input�c�haracters.�������3[V��eariable]���G�rl_hook_func_t���*��rl�� �R� �� #؎�|ev���en�t�� �R� �� #؎�ho�b"ok����.���If��non-zero,�0�this�is�the�address�of�a�function�to�call�p�M�erio�dically��when�Readline�is����.��w��!aiting��*for�terminal�input.��By�default,���this�will�b�M�e�called�at�most�ten�times�a�second����.��if��fthere�is�no�k��!eyb�M�oard�input.�������3[V��eariable]���G�rl_getc_func_t���*��rl�� �R� �� #؎�|getc�� �R� �� #؎�function����.���If��Wnon-zero,���Readline�will�call�indirectly�through�this�p�M�oin��!ter�to�get�a�c�haracter�from����.��the��`input�stream.���By�default,��^it�is�set�to��rl_getc�,�the�default�Readline�c��!haracter����.��input��ffunction�(see�Section�2.4.8�[Character�Input],�page�34).�������3[V��eariable]���G�rl_voidfunc_t���*��rl�� �R� �� #؎�|redispla���y�� �R� �� #؎�function����.���If�S�non-zero,�~�Readline�will�call�indirectly�through�this�p�M�oin��!ter�to�up�date�the�displa��!y����.��with�=�the�curren��!t�con�ten�ts�of�the�editing�buer.��By�default,�R�it�is�set�to��rl_redisplay�,����.��the��fdefault�Readline�redispla��!y�function�(see�Section�2.4.6�[Redispla�y],�page�32).�������3[V��eariable]���G�rl_vintfunc_t���*��rl�� �R� �� #؎�|prep�� �R� �� #؎�term�� �R� �� #؎�function����.���If���non-zero,� �Readline�will�call�indirectly�through�this�p�M�oin��!ter�to�initialize�the�terminal.����.��The�u�function�tak��!es�a�single�argumen�t,��Gan��int��
ag�that�sa�ys�whether�or�not�to�use����.��eigh��!t-bit��c�haracters.�5By�default,�5athis�is�set�to��rl_prep_terminal��(see�Section�2.4.9����.��[T��eerminal��fManagemen��!t],�page�35).�������3[V��eariable]���G�rl_voidfunc_t���*��rl�� �R� �� #؎�|deprep�� �R� �� #؎�term�� �R� �� #؎�function����.���If�eynon-zero,��>Readline�will�call�indirectly�through�this�p�M�oin��!ter�to�reset�the�terminal.����.��This�4�function�should�undo�the�eects�of��rl_prep_term_function�.��XBy�default,�Xthis����.��is��fset�to��rl_deprep_terminal��(see�Section�2.4.9�[T��eerminal�Managemen��!t],�page�35).�������3[V��eariable]���G�Keymap����rl�� �R� �� #؎�|executing�� �R� �� #؎�k���eymap����.���This�ROv��dDariable�is�set�to�the�k��!eymap�(see�Section�2.4.2�[Keymaps],�}Hpage�28)�in�whic�h����.��the��fcurren��!tly�executing�readline�function�w�as�found.�������3[V��eariable]���G�Keymap����rl�� �R� �� #؎�|binding�� �R� �� #؎�k���eymap����.���This�ROv��dDariable�is�set�to�the�k��!eymap�(see�Section�2.4.2�[Keymaps],�}Hpage�28)�in�whic�h����.��the��flast�k��!ey�binding�o�M�ccurred.�������3[V��eariable]���G�char���*��rl�� �R� �� #؎�|executing�� �R� �� #؎�macro����.���This��fv��dDariable�is�set�to�the�text�of�an��!y�curren�tly-executing�macro.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|readline�� �R� �� #؎�state����.���A�#�v��dDariable�#�with�bit�v�alues�that�encapsulate�the�curren��!t�Readline�state.�VA�#�bit�is�set����.��with���the��RL_SETSTATE��macro,�Ǔand�unset�with�the��RL_UNSETSTATE��macro.���Use�the����.���RL_ISSTATE�z �macro�to�test�whether�a�particular�state�bit�is�set.�X�Curren��!t�state�bits����.��include:���� \���� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ27�����3*�����֍�.���RL_STATE_NONE��
33��hʏ�Readline��fhas�not�y��!et�b�M�een�called,�nor�has�it�b�egun�to�in��!tialize.������.���RL_STATE_INITIALIZING����hʏ�Readline��fis�initializing�its�in��!ternal�data�structures.����.���RL_STATE_INITIALIZED����hʏ�Readline��fhas�completed�its�initialization.����.���RL_STATE_TERMPREPPED����hʏ�Readline�r[has�mo�M�died�the�terminal�mo�des�to�do�its�o��!wn�input�and�redis-����hʏpla��!y��e.����.���RL_STATE_READCMD����hʏ�Readline��fis�reading�a�command�from�the�k��!eyb�M�oard.����.���RL_STATE_METANEXT����hʏ�Readline��fis�reading�more�input�after�reading�the�meta-prex�c��!haracter.����.���RL_STATE_DISPATCHING����hʏ�Readline��fis�dispatc��!hing�to�a�command.����.���RL_STATE_MOREINPUT����hʏ�Readline��fis�reading�more�input�while�executing�an�editing�command.����.���RL_STATE_ISEARCH����hʏ�Readline��fis�p�M�erforming�an�incremen��!tal�history�searc�h.����.���RL_STATE_NSEARCH����hʏ�Readline��fis�p�M�erforming�a�non-incremen��!tal�history�searc�h.����.���RL_STATE_SEARCH����hʏ�Readline�p�is�searc��!hing�bac�kw�ard�or�forw�ard�through�the�history�for�a�string.����.���RL_STATE_NUMERICARG����hʏ�Readline��fis�reading�a�n��!umeric�argumen�t.����.���RL_STATE_MACROINPUT����hʏ�Readline��is�curren��!tly�getting�its�input�from�a�previously-dened�k�eyb�M�oard����hʏmacro.����.���RL_STATE_MACRODEF����hʏ�Readline��fis�curren��!tly�reading�c�haracters�dening�a�k�eyb�M�oard�macro.����.���RL_STATE_OVERWRITE����hʏ�Readline��fis�in�o��!v�erwrite��fmo�M�de.����.���RL_STATE_COMPLETING����hʏ�Readline��fis�p�M�erforming�w��!ord�completion.����.���RL_STATE_SIGHANDLER����hʏ�Readline��fis�curren��!tly�executing�the�readline�signal�handler.����.���RL_STATE_UNDOING����hʏ�Readline��fis�p�M�erforming�an�undo.����.���RL_STATE_DONE����hʏ�Readline�T�has�read�a�k��!ey�sequence�b�M�ound�to��accept-line��and�is�ab�out�to����hʏreturn��fthe�line�to�the�caller.���� k���� ���G�28�9pGNU��fReadline�Library�����3*�����֍����3[V��eariable]���G�int����rl�� �R� �� #؎�|explicit�� �R� �� #؎�arg��
33��.���Set��]to�a�non-zero�v��dDalue�if�an�explicit�n��!umeric�argumen�t�w�as�sp�M�ecied�b�y�the�user.����.��Only��fv��dDalid�in�a�bindable�command�function.��ۗ�����3[V��eariable]���G�int����rl�� �R� �� #؎�|n���umeric�� �R� �� #؎�arg����.���Set�r,to�the�v��dDalue�of�an��!y�n�umeric�argumen�t�explicitly�sp�M�ecied�b�y�the�user�b�M�efore����.��executing��the�curren��!t�Readline�function.��LOnly�v��dDalid�in�a�bindable�command�function.�������3[V��eariable]���G�int����rl�� �R� �� #؎�|editing�� �R� �� #؎�mo�b"de����.���Set�pto�a�v��dDalue�denoting�Readline's�curren��!t�editing�mo�M�de.���A�Fv�alue�of��1���means�Readline����.��is��fcurren��!tly�in�emacs�mo�M�de;��0����means�that�vi�mo�de�is�activ��!e.���}���G�X2.4��Readline�f@Con���v�enience�F���functions���(ۗ���G�a2.4.1�d(Naming��Ma�F��ģunction�������!G�The��luser�can�dynamically�c��!hange�the�bindings�of�k�eys�while�using�Readline.�=�This�is����Gdone�m.b��!y�represen�ting�the�function�with�a�descriptiv�e�name.�26The�user�is�able�to�t�yp�M�e�the����Gdescriptiv��!e��fname�when�referring�to�the�function.���Th�us,�in�an�init�le,�one�migh�t�nd���e��.���Meta-Rubout:�Tbackward-kill-word����!G�This��0binds�the�k��!eystrok�e����0����h��������@ � ff 2)n�� ��Meta-Rub�<rout������ٚ� ff 2)n���9_ܞ���i���A���to��0the�function��descriptively��1�named��backward-��
33��Gkill-word�.�UfY��eou,���as�x�the�programmer,�should�bind�the�functions�y��!ou�write�to�descriptiv�e����Gnames��fas�w��!ell.���Readline�pro�vides�a�function�for�doing�that:�������z[F��eunction]���G�int����rl�� �R� �� #؎�|add�� �R� �� #؎�defun�y��7m#�R
�3
cmss10�(�const��fchar�*name,�rl_command_func_t�*function,����DGint��fkey�)����.���Add�<��name���to�the�list�of�named�functions.���Mak��!e��function��b�M�e�the�function�that�gets����.��called.���If��f�k��!ey��~�is�not�-1,�then�bind�it�to��function��using��rl_bind_key()�.����!GUsing��this�function�alone�is�sucien��!t�for�most�applications.��It�is�the�recommended�w�a�y����Gto�<�add�a�few�functions�to�the�default�functions�that�Readline�has�built�in.���If�y��!ou�need�to�do����Gsomething�{other�than�adding�a�function�to�Readline,�$�y��!ou�ma�y�need�to�use�the�underlying����Gfunctions��fdescrib�M�ed�b�elo��!w.���d���G�a2.4.2�d(Selecting��Ma�Keymap�������!G�Key��abindings�tak��!e�place�on�a��k�eymap�.�
�The�k�eymap�is�the�asso�M�ciation�b�et��!w�een��athe�k��!eys����Gthat�k8the�user�t��!yp�M�es�and�the�functions�that�get�run.��#Y��eou�can�mak�e�y�our�o�wn�k�eymaps,�wcop�y����Gexisting��fk��!eymaps,�and�tell�Readline�whic�h�k�eymap�to�use.�������z[F��eunction]���G�Keymap����rl�� �R� �� #؎�|mak���e�� �R� �� #؎�bare�� �R� �� #؎�k�eymap�y��(�void�)����.���Returns��Ea�new,��empt��!y�k�eymap.���The�space�for�the�k�eymap�is�allo�M�cated�with��malloc()�;����.��the��fcaller�should�free�it�b��!y�calling��rl_discard_keymap()��when�done.�������z[F��eunction]���G�Keymap����rl�� �R� �� #؎�|cop���y�� �R� �� #؎�k�eymap�y��(�Keymap��fmap�)����.���Return��fa�new�k��!eymap�whic�h�is�a�cop�y�of��map�.���� sz��� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ29�����3*�����֍����z[F��eunction]���G�Keymap����rl�� �R� �� #؎�|mak���e�� �R� �� #؎�k�eymap�y��(�void�)��
33��.���Return�Ŭa�new�k��!eymap�with�the�prin�ting�c�haracters�b�M�ound�to�rl�� �>� x� H����tinsert,��}the�lo�w�ercase����.��Meta���c��!haracters�b�M�ound�to�run�their�equiv��dDalen�ts,���and�the�Meta�digits�b�M�ound�to�pro�duce����.��n��!umeric��fargumen�ts.��)㍍���z[F��eunction]���G�void����rl�� �R� �� #؎�|discard�� �R� �� #؎�k���eymap�y��(�Keymap��fkeymap�)����.���F��eree��fthe�storage�asso�M�ciated�with��k��!eymap�.����!GReadline�qhas�sev��!eral�in�ternal�k�eymaps.�
>These�functions�allo�w�y�ou�to�c�hange�whic�h����Gk��!eymap��fis�activ�e.�������z[F��eunction]���G�Keymap����rl�� �R� �� #؎�|get�� �R� �� #؎�k���eymap�y��(�void�)����.���Returns��fthe�curren��!tly�activ�e�k�eymap.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|set�� �R� �� #؎�k���eymap�y��(�Keymap��fkeymap�)����.���Mak��!es��f�k�eymap��g�the�curren�tly�activ�e�k�eymap.�������z[F��eunction]���G�Keymap����rl�� �R� �� #؎�|get�� �R� �� #؎�k���eymap�� �R� �� #؎�b�y�� �R� �� #؎�name�y��(�const��fchar�*name�)����.���Return��>the�k��!eymap�matc�hing��name�.��d�name��E�is�one�whic�h�w�ould�b�M�e�supplied�in�a��set����.��keymap��f�inputrc�line�(see�Section�1.3�[Readline�Init�File],�page�4).�������z[F��eunction]���G�char���*��rl�� �R� �� #؎�|get�� �R� �� #؎�k���eymap�� �R� �� #؎�name�y��(�Keymap��fkeymap�)����.���Return��>the�name�matc��!hing��k�eymap�.��d�name��E�is�one�whic�h�w�ould�b�M�e�supplied�in�a��set����.��keymap��f�inputrc�line�(see�Section�1.3�[Readline�Init�File],�page�4).�������G�a2.4.3�d(Binding��MKeys���
���!G�Key�ߺsequences�are�asso�M�ciate�with�functions�through�the�k��!eymap.���Readline�has�sev�eral�in-����Gternal���k��!eymaps:���emacs_standard_keymap�,��<�emacs_meta_keymap�,��emacs_ctlx_keymap�,��vi_����Gmovement_keymap�,�qxand���vi_insertion_keymap�.� +��emacs_standard_keymap��is�the�default,����Gand��fthe�examples�in�this�man��!ual�assume�that.���Í�!GSince�Q�readline()��installs�a�set�of�default�k��!ey�bindings�the�rst�time�it�is�called,�b#there�is����Galw��!a�ys���the�danger�that�a�custom�binding�installed�b�M�efore�the�rst�call�to��readline()��will����Gb�M�e�o��!v�erridden.��An�alternate�mec�hanism�is�to�install�custom�k�ey�bindings�in�an�initialization����Gfunction�u�assigned�to�the��rl_startup_hook��v��dDariable�(see�Section�2.3�[Readline�V��eariables],����Gpage��f24).����!GThese��ffunctions�manage�k��!ey�bindings.��)㍍���z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���ey�y��(�int��fkey,�rl_command_func_t�*function�)����.���Binds����k��!ey����to��function��in�the�curren�tly�activ�e�k�eymap.���Returns�non-zero�in�the�case����.��of��fan�in��!v��dDalid��k�ey�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���ey�� �R� �� #؎�in�� �R� �� #؎�map�y��(�int��fkey,�rl_command_func_t�*function,����DGKeymap��fmap�)����.���Bind��f�k��!ey��~�to��function��in��map�.���Returns�non-zero�in�the�case�of�an�in�v��dDalid��k�ey�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���ey�� �R� �� #؎�if�� �R� �� #؎�un�b�b"ound�y��(�int��fkey,�rl_command_func_t����DG*function�)����.���Binds�I�k��!ey�9,�to��function��if�it�is�not�already�b�M�ound�in�the�curren�tly�activ�e�k�eymap.����.��Returns��fnon-zero�in�the�case�of�an�in��!v��dDalid��k�ey��~�or�if��k�ey��~�is�already�b�M�ound.���� ����� ���G�30�9pGNU��fReadline�Library�����3*�����֍����z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���ey�� �R� �� #؎�if�� �R� �� #؎�un�b�b"ound�� �R� �� #؎�in�� �R� �� #؎�map�y��(�int��fkey,��
33��DGrl_command_func_t��f*function,�Keymap�map�)����.���Binds�G��k��!ey�7��to��function��if�it�is�not�already�b�M�ound�in��map�.��WReturns�non-zero�in�the�case����.��of��fan�in��!v��dDalid��k�ey��~�or�if��k�ey��~�is�already�b�M�ound.���̍����z[F��eunction]���G�int����rl�� �R� �� #؎�|un���bind�� �R� �� #؎�k�ey�y��(�int��fkey�)����.���Bind�[r�k��!ey�K��to�the�n�ull�function�in�the�curren�tly�activ�e�k�eymap.��Returns�non-zero�in����.��case��fof�error.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|un���bind�� �R� �� #؎�k�ey�� �R� �� #؎�in�� �R� �� #؎�map�y��(�int��fkey,�Keymap�map�)����.���Bind��f�k��!ey��~�to�the�n�ull�function�in��map�.���Returns�non-zero�in�case�of�error.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|un���bind�� �R� �� #؎�function�� �R� �� #؎�in�� �R� �� #؎�map�y��(�rl_command_func_t��f*function,����DGKeymap��fmap�)����.���Un��!bind��fall�k�eys�that�execute��function��in��map�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|un���bind�� �R� �� #؎�command�� �R� �� #؎�in�� �R� �� #؎�map�y��(�const��fchar�*command,�Keymap����DGmap�)����.���Un��!bind��fall�k�eys�that�are�b�M�ound�to��command���in��map�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���eyseq�y��(�const��fchar�*keyseq,�rl_command_func_t����DG*function�)����.���Bind�,�the�k��!ey�sequence�represen�ted�b�y�the�string��k�eyseq�mt�to�the�function��function�,����.��b�M�eginning�c�in�the�curren��!t�k�eymap.�ǠThis�mak�es�new�k�eymaps�as�necessary��e.�ǠThe�return����.��v��dDalue��fis�non-zero�if��k��!eyseq��L�is�in�v��dDalid.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���eyseq�� �R� �� #؎�in�� �R� �� #؎�map�y��(�const��fchar�*keyseq,����DGrl_command_func_t��f*function,�Keymap�map�)����.���Bind��the�k��!ey�sequence�represen�ted�b�y�the�string��k�eyseq�B��to�the�function��function�.���This����.��mak��!es��&new�k�eymaps�as�necessary��e.��Initial�bindings�are�p�M�erformed�in��map�.�The�return����.��v��dDalue��fis�non-zero�if��k��!eyseq��L�is�in�v��dDalid.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|set�� �R� �� #؎�k���ey�y��(�const��fchar�*keyseq,�rl_command_func_t�*function,����DGKeymap��fmap�)����.���Equiv��dDalen��!t��fto��rl_bind_keyseq_in_map�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���eyseq�� �R� �� #؎�if�� �R� �� #؎�un�b�b"ound�y��(�const��fchar�*keyseq,����DGrl_command_func_t��f*function�)����.���Binds�C��k��!eyseq����to��function��if�it�is�not�already�b�M�ound�in�the�curren�tly�activ�e�k�eymap.����.��Returns��fnon-zero�in�the�case�of�an�in��!v��dDalid��k�eyseq��L�or�if��k�eyseq��L�is�already�b�M�ound.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|bind�� �R� �� #؎�k���eyseq�� �R� �� #؎�if�� �R� �� #؎�un�b�b"ound�� �R� �� #؎�in�� �R� �� #؎�map�y��(�const��fchar�*keyseq,����DGrl_command_func_t��f*function,�Keymap�map�)����.���Binds���k��!eyseq���to��function��if�it�is�not�already�b�M�ound�in��map�.�o�Returns�non-zero�in�the����.��case��fof�an�in��!v��dDalid��k�eyseq��L�or�if��k�eyseq��L�is�already�b�M�ound.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|generic�� �R� �� #؎�bind�y��(�int��ftype,�const�char�*keyseq,�char�*data,����DGKeymap��fmap�)����.���Bind�>�the�k��!ey�sequence�represen�ted�b�y�the�string��k�eyseq���to�the�arbitrary�p�M�oin�ter��data�.����.���t��!yp�M�e���sa�ys�j�what�kind�of�data�is�p�oin��!ted�to�b�y��data�;�~�this�can�b�M�e�a�function�(�ISFUNC�),�v�a����.��macro���(�ISMACR�),��(or�a�k��!eymap�(�ISKMAP�).�ԙThis�mak�es�new�k�eymaps�as�necessary��e.�ԙThe����.��initial��fk��!eymap�in�whic�h�to�do�bindings�is��map�.���� �4��� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ31�����3*�����֍����z[F��eunction]���G�int����rl�� �R� �� #؎�|parse�� �R� �� #؎�and�� �R� �� #؎�bind�y��(�char��f*line�)��
33��.���P��!arse��y�line�$��as�if�it�had�b�M�een�read�from�the��inputrc��le�and�p�erform�an��!y�k�ey�bindings����.��and��fv��dDariable�assignmen��!ts�found�(see�Section�1.3�[Readline�Init�File],�page�4).���_�����z[F��eunction]���G�int����rl�� �R� �� #؎�|read�� �R� �� #؎�init�� �R� �� #؎�le�y��(�const��fchar�*filename�)����.���Read��8k��!eybindings�and�v��dDariable�assignmen�ts�from��lename�e?�(see�Section�1.3�[Readline����.��Init��fFile],�page�4).���,���G�a2.4.4�d(Asso�iciating��MF��ģunction�Names�and�Bindings����|��!G�These��Qfunctions�allo��!w�y�ou�to�nd�out�what�k�eys�in�v�ok�e�named�functions�and�the�functions����Gin��!v�ok�ed�MLb�y�a�particular�k�ey�sequence.��*Y��eou�ma�y�also�asso�M�ciate�a�new�function�name�with�an����Garbitrary��ffunction.�������z[F��eunction]���G�rl_command_func_t���*��rl�� �R� �� #؎�|named�� �R� �� #؎�function�y��(�const��fchar�*name�)����.���Return��fthe�function�with�name��name�.�������z[F��eunction]���G�rl_command_func_t���*��rl�� �R� �� #؎�|function�� �R� �� #؎�of�� �R� �� #؎�k���eyseq�y��(�const��fchar�*keyseq,����DGKeymap��fmap,�int�*type�)����.���Return��the�function�in��!v�ok�ed��b�y��k�eyseq�)��in�k�eymap��map�.���If��map�=��is��NULL�,��Fthe�curren�t����.��k��!eymap�q�is�used.�?�If��t�yp�M�e���is�not��NULL�,��tthe�t�yp�M�e�of�the�ob� ��ject�is�returned�in�the��int����.���v��dDariable��fit�p�M�oin��!ts�to�(one�of��ISFUNC�,��ISKMAP�,�or��ISMACR�).�������z[F��eunction]���G�char���**��rl�� �R� �� #؎�|in���v�oking�� �R� �� #؎�k�eyseqs�y��(�rl_command_func_t��f*function�)����.���Return���an�arra��!y�of�strings�represen�ting�the�k�ey�sequences�used�to�in�v�ok�e��function��in����.��the��fcurren��!t�k�eymap.�������z[F��eunction]���G�char���**��rl�� �R� �� #؎�|in���v�oking�� �R� �� #؎�k�eyseqs�� �R� �� #؎�in�� �R� �� #؎�map�y��(�rl_command_func_t����DG*function,��fKeymap�map�)����.���Return���an�arra��!y�of�strings�represen�ting�the�k�ey�sequences�used�to�in�v�ok�e��function��in����.��the��fk��!eymap��map�.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|function�� �R� �� #؎�dump�b"er�y��(�int��freadable�)����.���Prin��!t���the�readline�function�names�and�the�k�ey�sequences�curren�tly�b�M�ound�to�them�to����.���rl_outstream�.���If�LM�readable��T�is�non-zero,�^Rthe�list�is�formatted�in�suc��!h�a�w�a�y�that�it�can����.��b�M�e��fmade�part�of�an��inputrc��le�and�re-read.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|list�� �R� �� #؎�funmap�� �R� �� #؎�names�y��(�void�)����.���Prin��!t��fthe�names�of�all�bindable�Readline�functions�to��rl_outstream�.�������z[F��eunction]���G�const���char�**��rl�� �R� �� #؎�|funmap�� �R� �� #؎�names�y��(�void�)����.���Return�Sa�NULL�0terminated�arra��!y�of�kno�wn�function�names.���The�arra�y�is�sorted.���The����.��arra��!y� itself�is�allo�M�cated,�(�but�not�the�strings�inside.��jY��eou�should��free()��the�arra�y�when����.��y��!ou��fare�done,�but�not�the�p�M�oin�ters.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|add�� �R� �� #؎�funmap�� �R� �� #؎�en���try�y��(�const��fchar�*name,�rl_command_func_t����DG*function�)����.���Add���name����to�the�list�of�bindable�Readline�command�names,�Gand�mak��!e��function��the����.��function��fto�b�M�e�called�when��name�Cm�is�in��!v�ok�ed.���� �Q��� ���G�32�9pGNU��fReadline�Library�����3*�����֍��G�a2.4.5�d(Allo���wing��MUndoing������!G�Supp�M�orting�&�the�undo�command�is�a�painless�thing,�@and�mak��!es�y�our�functions�m�uc�h�more��
33��Guseful.���It��fis�certainly�easy�to�try�something�if�y��!ou�kno�w�y�ou�can�undo�it.���卑!GIf��*y��!our�function�simply�inserts�text�once,�8�or�deletes�text�once,�and�uses��rl_insert_����Gtext()�Y)�or��rl_delete_text()��to�do�it,�h�then�undoing�is�already�done�for�y��!ou�automatically��e.����!GIf�u�y��!ou�do�m�ultiple�insertions�or�m�ultiple�deletions,���or�an�y�com�bination�of�these�op�M�erations,����Gy��!ou���should�group�them�together�in�to�one�op�M�eration.��]This�is�done�with��rl_begin_undo_����Ggroup()��f�and��rl_end_undo_group()�.����!GThe��ft��!yp�M�es�of�ev�en�ts�that�can�b�M�e�undone�are:������.���ߤN cmtt9�enum���undo_code�{�UNDO_DELETE,�UNDO_INSERT,�UNDO_BEGIN,�UNDO_END�};����!G�Notice���that��UNDO_DELETE��means�to�insert�some�text,��:and��UNDO_INSERT��means�to�delete����Gsome�O�text.���That�is,�a the�undo�co�M�de�tells�what�to�undo,�not�ho��!w�to�undo�it.����UNDO_BEGIN��and����G�UNDO_END��f�are�tags�added�b��!y��rl_begin_undo_group()��and��rl_end_undo_group()�.���J�����z[F��eunction]���G�int����rl�� �R� �� #؎�|b�b"egin�� �R� �� #؎�undo�� �R� �� #؎�group�y��(�void�)����.���Begins���sa��!ving�undo�information�in�a�group�construct.�AThe�undo�information�usually����.��comes��Ifrom�calls�to��rl_insert_text()��and��rl_delete_text()�,�TAbut�could�b�M�e�the����.��result��fof�calls�to��rl_add_undo()�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|end�� �R� �� #؎�undo�� �R� �� #؎�group�y��(�void�)����.���Closes�{the�curren��!t�undo�group�started�with��rl_begin_undo_group��f()�.��mThere�should����.��b�M�e��fone�call�to��rl_end_undo_group()��for�eac��!h�call�to��rl_begin_undo_group()�.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|add�� �R� �� #؎�undo�y��(�enum��fundo_code�what,�int�start,�int�end,�char����DG*text�)����.���Remem��!b�M�er��ho�w�to�undo�an�ev�en�t�(according�to��what�= �).�/rThe�aected�text�runs�from����.���start��f�to��f�end�,�and�encompasses��text�.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|free�� �R� �� #؎�undo�� �R� �� #؎�list�y��(�void�)����.���F��eree��fthe�existing�undo�list.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|do�� �R� �� #؎�undo�y��(�void�)����.���Undo���the�rst�thing�on�the�undo�list.���Returns��0��if�there�w��!as�nothing�to�undo,�� non-zero����.��if��fsomething�w��!as�undone.����!GFinally��e,��#if���y��!ou�neither�insert�nor�delete�text,�but�directly�mo�M�dify�the�existing�text�(e.g.,����Gc��!hange��its�case),��Kcall��rl_modifying()��once,�just�b�M�efore�y��!ou�mo�dify�the�text.��Y��eou�m��!ust����Gsupply��fthe�indices�of�the�text�range�that�y��!ou�are�going�to�mo�M�dify��e.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|mo�b"difying�y��(�int��fstart,�int�end�)����.���T��eell��-Readline�to�sa��!v�e��-the�text�b�M�et��!w�een��-�start�-�and��end�B�as�a�single�undo�unit.�g3It�is����.��assumed��fthat�y��!ou�will�subsequen�tly�mo�M�dify�that�text.��v���G�a2.4.6�d(Redispla���y���������z�[F��eunction]���G�void����rl�� �R� �� #؎�|redispla���y�y��(�void�)����.���Change���what's�displa��!y�ed���on�the�screen�to�re
ect�the�curren��!t�con�ten�ts�of��rl_line_����.��buffer�.���� ! ����� ���G�Chapter��f2:���Programming�with�GNU�Readline� ʗ33�����3*�����֍����z[F��eunction]���G�int����rl�� �R� �� #؎�|forced�� �R� �� #؎�up�b"date�� �R� �� #؎�displa���y�y��(�void�)��
33��.���F��eorce���the�line�to�b�M�e�up�dated�and�redispla��!y�ed,��whether���or�not�Readline�thinks�the����.��screen��fdispla��!y�is�correct.������z[F��eunction]���G�int����rl�� �R� �� #؎�|on�� �R� �� #؎�new�� �R� �� #؎�line�y��(�void�)����.���T��eell���the�up�M�date�functions�that�w��!e�ha�v�e�mo�v�ed�on�to�a�new�(empt�y)�line,��!usually�after����.��ouputting��fa�newline.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|on�� �R� �� #؎�new�� �R� �� #؎�line�� �R� �� #؎�with�� �R� �� #؎�prompt�y��(�void�)����.���T��eell��_the�up�M�date�functions�that�w��!e�ha�v�e�mo�v�ed�on�to�a�new�line,�
awith��rl�� �>� x� H����tprompt� _�already����.��displa��!y�ed.�ˮThis�o�could�b�M�e�used�b��!y�applications�that�w�an�t�to�output�the�prompt�string����.��themselv��!es,�\�but�J_still�need�Readline�to�kno�w�the�prompt�string�length�for�redispla�y��e.��0It����.��should��fb�M�e�used�after�setting��rl�� �>� x� H����talready�� �>� x� H���prompted�.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|reset�� �R� �� #؎�line�� �R� �� #؎�state�y��(�void�)����.���Reset�*�the�displa��!y�state�to�a�clean�state�and�redispla�y�the�curren�t�line�starting�on�a����.��new��fline.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|crlf�y��(�void�)����.���Mo��!v�e��fthe�cursor�to�the�start�of�the�next�screen�line.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|sho���w�� �R� �� #؎�c�har�y��(�int��fc�)����.���Displa��!y��c�haracter��c����on��rl_outstream�.���If�Readline�has�not�b�M�een�set�to�displa�y�meta����.��c��!haracters��directly��e,�9(this�will�con�v�ert�meta�c�haracters�to�a�meta-prexed�k�ey�sequence.����.��This��fis�in��!tended�for�use�b�y�applications�whic�h�wish�to�do�their�o�wn�redispla�y��e.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|message�y��(�const��fchar�*,��...���e�)����.���The�y�argumen��!ts�are�a�format�string�as�w�ould�b�M�e�supplied�to��printf�,���p�ossibly�con��!taining����.��con��!v�ersion�N�sp�M�ecications�suc��!h�as�`�%d�',���and�an�y�additional�argumen�ts�necessary�to����.��satisfy���the�con��!v�ersion���sp�M�ecications.��jThe�resulting�string�is�displa��!y�ed���in�the��ec��!ho����.��area�.�q�The��Lec��!ho�area�is�also�used�to�displa�y�n�umeric�argumen�ts�and�searc�h�strings.����.��Y��eou��should�call��rl_save_prompt��to�sa��!v�e��the�prompt�information�b�M�efore�calling�this����.��function.�������z[F��eunction]���G�int����rl�� �R� �� #؎�|clear�� �R� �� #؎�message�y��(�void�)����.���Clear�zthe�message�in�the�ec��!ho�area.��If�the�prompt�w�as�sa�v�ed�with�a�call�to��rl_save_����.��prompt��o�b�M�efore�the�last�call�to��rl_message�,� �call��rl_restore_prompt��b�efore�calling����.��this��ffunction.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|sa���v�e�� �R� �� #؎�prompt�y��(�void�)����.���Sa��!v�e�,the�lo�M�cal�Readline�prompt�displa��!y�state�in�preparation�for�displa�ying�a�new����.��message��fin�the�message�area�with��rl_message()�.�������z[F��eunction]���G�void����rl�� �R� �� #؎�|restore�� �R� �� #؎�prompt�y��(�void�)����.���Restore�!Pthe�lo�M�cal�Readline�prompt�displa��!y�state�sa�v�ed�b�y�the�most�recen�t�call�to����.���rl_save_prompt�.���if��m�rl_save_prompt��w��!as�called�to�sa�v�e�the�prompt�b�M�efore�a�call����.��to�k7�rl_message�,��kthis�function�should�b�M�e�called�b�efore�the�corresp�onding�call�to��rl_����.��clear_message�.���� "