readline.read_init_file()

readline.read_init_file([filename]) Execute a readline initialization file. The default filename is the last filename used. This calls rl_read_init_file() in the underlying library.

readline.read_history_file()

readline.read_history_file([filename]) Load a readline history file, and append it to the history list. The default filename is ~/.history. This calls read_history() in the underlying library.

readline.parse_and_bind()

readline.parse_and_bind(string) Execute the init line provided in the string argument. This calls rl_parse_and_bind() in the underlying library.

readline.insert_text()

readline.insert_text(string) Insert text into the line buffer at the cursor position. This calls rl_insert_text() in the underlying library, but ignores the return value.

readline.get_line_buffer()

readline.get_line_buffer() Return the current contents of the line buffer (rl_line_buffer in the underlying library).

readline.get_history_length()

readline.get_history_length() readline.set_history_length(length) Set or return the desired number of lines to save in the history file. The write_history_file() function uses this value to truncate the history file, by calling history_truncate_file() in the underlying library. Negative values imply unlimited history file size.

readline.get_history_item()

readline.get_history_item(index) Return the current contents of history item at index. The item index is one-based. This calls history_get() in the underlying library.

readline.get_endidx()

readline.get_endidx() Get the beginning or ending index of the completion scope. These indexes are the start and end arguments passed to the rl_attempted_completion_function callback of the underlying library.

readline.get_current_history_length()

readline.get_current_history_length() Return the number of items currently in the history. (This is different from get_history_length(), which returns the maximum number of lines that will be written to a history file.)

readline.get_completion_type()

readline.get_completion_type() Get the type of completion being attempted. This returns the rl_completion_type variable in the underlying library as an integer.