:right-sidebar: True Terminal =================================================================== .. currentmodule:: gi.repository.Vte .. class:: Terminal(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.AccessibleText`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Scrollable` :Constructors: :: Terminal(**properties) new() -> Vte.Terminal Constructors ------------ .. rst-class:: interim-class .. class:: Terminal :no-index: .. classmethod:: new() -> ~gi.repository.Vte.Terminal Creates a new terminal widget. Methods ------- .. rst-class:: interim-class .. class:: Terminal :no-index: .. method:: check_hyperlink_at(x: float, y: float) -> str | None Returns a nonempty string: the target of the explicit hyperlink (printed using the OSC 8 escape sequence) at the position (x, y), or :const:`None`. Proper use of the escape sequence should result in URI-encoded URIs with a proper scheme like "http://", "https://", "file://", "mailto:" etc. This is, however, not enforced by VTE. The caller must tolerate the returned string potentially not being a valid URI. .. versionadded:: 0.70 :param x: :param y: .. method:: check_match_at(x: float, y: float) -> ~typing.Tuple[str | None, int] Checks if the text in and around the position (x, y) matches any of the regular expressions previously set using vte_terminal_match_add(). If a match exists, the text string is returned and if ``tag`` is not :const:`None`, the number associated with the matched regular expression will be stored in ``tag``\. If more than one regular expression has been set with vte_terminal_match_add(), then expressions are checked in the order in which they were added. .. versionadded:: 0.70 :param x: :param y: .. method:: check_regex_simple_at(x: float, y: float, regexes: list[~gi.repository.Vte.Regex], match_flags: int) -> list[str] | None Checks each regex in ``regexes`` if the text in and around the position (x, y) matches the regular expressions. If a match exists, the matched text is stored in ``matches`` at the position of the regex in ``regexes``\; otherwise :const:`None` is stored there. Each non-:const:`None` element of ``matches`` should be freed with :func:`~gi.repository.GLib.free`. Note that the regexes in ``regexes`` should have been created using the %PCRE2_MULTILINE flag. .. versionadded:: 0.70 :param x: :param y: :param regexes: an array of :obj:`~gi.repository.Vte.Regex` :param match_flags: PCRE2 match flags, or 0 .. method:: do_bell(self) -> None .. method:: do_char_size_changed(self, char_width: int, char_height: int) -> None :param char_width: :param char_height: .. method:: do_child_exited(self, status: int) -> None :param status: .. method:: do_commit(self, text: str, size: int) -> None :param text: :param size: .. method:: do_contents_changed(self) -> None .. method:: do_cursor_moved(self) -> None .. method:: do_decrease_font_size(self) -> None .. method:: do_deiconify_window(self) -> None .. method:: do_encoding_changed(self) -> None .. method:: do_eof(self) -> None .. method:: do_icon_title_changed(self) -> None .. method:: do_iconify_window(self) -> None .. method:: do_increase_font_size(self) -> None .. method:: do_lower_window(self) -> None .. method:: do_maximize_window(self) -> None .. method:: do_move_window(self, x: int, y: int) -> None :param x: :param y: .. method:: do_paste_clipboard(self) -> None .. method:: do_raise_window(self) -> None .. method:: do_refresh_window(self) -> None .. method:: do_resize_window(self, width: int, height: int) -> None :param width: :param height: .. method:: do_restore_window(self) -> None .. method:: do_selection_changed(self) -> None .. method:: do_setup_context_menu(self, context: ~gi.repository.Vte.EventContext) -> None :param context: .. method:: do_termprop_changed(self, prop: str) -> None :param prop: .. method:: do_termprops_changed(self, props: int, n_props: int) -> bool :param props: :param n_props: .. method:: do_window_title_changed(self) -> None .. method:: dup_termprop_string(prop: str) -> ~typing.Tuple[str | None, int] Returns the value of a :const:`~gi.repository.Vte.PropertyType.STRING` termprop, or :const:`None` if ``prop`` is unset, or ``prop`` is not a registered property. .. versionadded:: 0.78 :param prop: a termprop name .. method:: dup_termprop_string_by_id(prop: int) -> ~typing.Tuple[str | None, int] Like :func:`~gi.repository.Vte.Terminal.dup_termprop_string` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: dup_termprop_uuid(prop: str) -> ~gi.repository.Vte.Uuid Returns the value of a :const:`~gi.repository.Vte.PropertyType.UUID` termprop as a :obj:`~gi.repository.Vte.Uuid`\, or :const:`None` if ``prop`` is unset, or ``prop`` is not a registered property. .. versionadded:: 0.78 :param prop: a termprop name .. method:: dup_termprop_uuid_by_id(prop: int) -> ~gi.repository.Vte.Uuid Like :func:`~gi.repository.Vte.Terminal.dup_termprop_uuid` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: feed(data: list[int] | None = None) -> None Interprets ``data`` as if it were data received from a child process. :param data: a string in the terminal's current encoding .. method:: feed_child(text: list[int] | None = None) -> None Sends a block of UTF-8 text to the child as if it were entered by the user at the keyboard. :param text: data to send to the child .. method:: feed_child_binary(data: list[int] | None = None) -> None Sends a block of binary data to the child. .. deprecated:: 0.60 Don't send binary data. Use :func:`~gi.repository.Vte.Terminal.feed_child` instead to send UTF-8 text :param data: data to send to the child .. method:: get_allow_bold() -> bool Checks whether or not the terminal will attempt to draw bold text, by using a bold font variant. .. deprecated:: 0.60 There's probably no reason for this feature to exist. .. method:: get_allow_hyperlink() -> bool Checks whether or not hyperlinks (OSC 8 escape sequence) are allowed. .. versionadded:: 0.50 .. method:: get_audible_bell() -> bool Checks whether or not the terminal will beep when the child outputs the "bl" sequence. .. method:: get_bold_is_bright() -> bool Checks whether the SGR 1 attribute also switches to the bright counterpart of the first 8 palette colors, in addition to making them bold (legacy behavior) or if SGR 1 only enables bold and leaves the color intact. .. versionadded:: 0.52 .. method:: get_cell_height_scale() -> float .. versionadded:: 0.52 .. method:: get_cell_width_scale() -> float .. versionadded:: 0.52 .. method:: get_char_height() -> int .. method:: get_char_width() -> int .. method:: get_cjk_ambiguous_width() -> int Returns whether ambiguous-width characters are narrow or wide. (Note that when using a non-UTF-8 encoding set via :func:`~gi.repository.Vte.Terminal.set_encoding`, the width of ambiguous-width characters is fixed and determined by the encoding itself.) .. method:: get_color_background_for_draw() -> ~gi.repository.Gdk.RGBA Returns the background colour, as used by ``terminal`` when drawing the background, which may be different from the color set by :func:`~gi.repository.Vte.Terminal.set_color_background`. Note: you must only call this function while handling the GtkWidget::draw signal. This function is rarely useful. One use for it is if you disable drawing the background (see :func:`~gi.repository.Vte.Terminal.set_clear_background`) and then need to draw the background yourself. .. versionadded:: 0.54 .. method:: get_column_count() -> int .. method:: get_context_menu() -> ~gi.repository.Gtk.Widget | None .. versionadded:: 0.76 .. method:: get_context_menu_model() -> ~gi.repository.Gio.MenuModel | None .. versionadded:: 0.76 .. method:: get_current_directory_uri() -> str | None .. deprecated:: 0.78 Use the %VTE_TERMPROP_CURRENT_FILE_URI_STRING termprop. .. method:: get_current_file_uri() -> str | None .. deprecated:: 0.78 Use the %VTE_TERMPROP_CURRENT_FILE_URI_STRING termprop. .. method:: get_cursor_blink_mode() -> ~gi.repository.Vte.CursorBlinkMode Returns the currently set cursor blink mode. .. method:: get_cursor_position() -> ~typing.Tuple[int, int] Reads the location of the insertion cursor and returns it. The row coordinate is absolute. This method is unaware of BiDi. The returned column is logical column. .. method:: get_cursor_shape() -> ~gi.repository.Vte.CursorShape Returns the currently set cursor shape. .. method:: get_enable_a11y() -> bool Checks whether the terminal communicates with a11y backends .. versionadded:: 0.78 .. method:: get_enable_bidi() -> bool Checks whether the terminal performs bidirectional text rendering. .. versionadded:: 0.58 .. method:: get_enable_fallback_scrolling() -> bool .. versionadded:: 0.64 .. method:: get_enable_legacy_osc777() -> bool .. versionadded:: 0.78 .. method:: get_enable_shaping() -> bool Checks whether the terminal shapes Arabic text. .. versionadded:: 0.58 .. method:: get_enable_sixel() -> bool .. versionadded:: 0.62 .. method:: get_encoding() -> str | None Determines the name of the encoding in which the terminal expects data to be encoded, or :const:`None` if UTF-8 is in use. .. deprecated:: 0.54 Support for non-UTF-8 is deprecated. .. method:: get_font() -> ~gi.repository.Pango.FontDescription Queries the terminal for information about the fonts which will be used to draw text in the terminal. The actual font takes the font scale into account, this is not reflected in the return value, the unscaled font is returned. .. method:: get_font_options() -> ~gi.repository.cairo.FontOptions | None .. versionadded:: 0.74 .. method:: get_font_scale() -> float .. method:: get_has_selection() -> bool Checks if the terminal currently contains selected text. Note that this is different from determining if the terminal is the owner of any ``GtkClipboard`` items. .. method:: get_icon_title() -> str | None .. deprecated:: 0.54 Please do not use it in newly written code .. method:: get_input_enabled() -> bool Returns whether the terminal allow user input. .. method:: get_mouse_autohide() -> bool Determines the value of the terminal's mouse autohide setting. When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse. This setting can be changed using :func:`~gi.repository.Vte.Terminal.set_mouse_autohide`. .. method:: get_pty() -> ~gi.repository.Vte.Pty Returns the :obj:`~gi.repository.Vte.Pty` of ``terminal``\. .. method:: get_rewrap_on_resize() -> bool Checks whether or not the terminal will rewrap its contents upon resize. .. deprecated:: 0.58 Please do not use it in newly written code .. method:: get_row_count() -> int .. method:: get_scroll_on_insert() -> bool .. versionadded:: 0.76 .. method:: get_scroll_on_keystroke() -> bool .. versionadded:: 0.52 .. method:: get_scroll_on_output() -> bool .. versionadded:: 0.52 .. method:: get_scroll_unit_is_pixels() -> bool .. versionadded:: 0.66 .. method:: get_scrollback_lines() -> int .. versionadded:: 0.52 .. method:: get_termprop_bool(prop: str) -> ~typing.Tuple[bool, bool] For a :const:`~gi.repository.Vte.PropertyType.BOOL` termprop, sets ``value`` to ``prop``\'s value, or to :const:`False` if ``prop`` is unset, or ``prop`` is not a registered property. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_bool_by_id(prop: int) -> ~typing.Tuple[bool, bool] Like :func:`~gi.repository.Vte.Terminal.get_termprop_bool` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_data(prop: str) -> list[int] Returns the value of a :const:`~gi.repository.Vte.PropertyType.DATA` termprop, or :const:`None` if ``prop`` is unset, or ``prop`` is not a registered property. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_data_by_id(prop: int) -> list[int] Like :func:`~gi.repository.Vte.Terminal.get_termprop_data` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_double(prop: str) -> ~typing.Tuple[bool, float] For a :const:`~gi.repository.Vte.PropertyType.DOUBLE` termprop, sets ``value`` to ``prop``\'s value, which is finite; or to 0.0 if ``prop`` is unset, or ``prop`` is not a registered property. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_double_by_id(prop: int) -> ~typing.Tuple[bool, float] Like :func:`~gi.repository.Vte.Terminal.get_termprop_double` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_int(prop: str) -> ~typing.Tuple[bool, int] For a :const:`~gi.repository.Vte.PropertyType.INT` termprop, sets ``value`` to ``prop``\'s value, or to 0 if ``prop`` is unset, or if ``prop`` is not a registered property. If only a subset or range of values are acceptable for the given property, the caller must validate the returned value and treat any out-of-bounds value as if the termprop had no value; in particular it *must not* clamp the values to the expected range. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_int_by_id(prop: int) -> ~typing.Tuple[bool, int] Like :func:`~gi.repository.Vte.Terminal.get_termprop_int` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_rgba(prop: str) -> ~typing.Tuple[bool, ~gi.repository.Gdk.RGBA] Stores the value of a :const:`~gi.repository.Vte.PropertyType.RGB` or :const:`~gi.repository.Vte.PropertyType.RGBA` termprop in ``color`` and returns :const:`True` if the termprop is set, or stores rgb(0,0,0) or rgba(0,0,0,1) in ``color`` and returns :const:`False` if the termprop is unset. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_rgba_by_id(prop: int) -> ~typing.Tuple[bool, ~gi.repository.Gdk.RGBA] Like :func:`~gi.repository.Vte.Terminal.get_termprop_rgba` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_string(prop: str) -> ~typing.Tuple[str | None, int] Returns the value of a :const:`~gi.repository.Vte.PropertyType.STRING` termprop, or :const:`None` if ``prop`` is unset, or ``prop`` is not a registered property. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_string_by_id(prop: int) -> ~typing.Tuple[str | None, int] Like :func:`~gi.repository.Vte.Terminal.get_termprop_string` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_uint(prop: str) -> ~typing.Tuple[bool, int] For a :const:`~gi.repository.Vte.PropertyType.UINT` termprop, sets ``value`` to ``prop``\'s value, or to 0 if ``prop`` is unset, or ``prop`` is not a registered property. If only a subset or range of values are acceptable for the given property, the caller must validate the returned value and treat any out-of-bounds value as if the termprop had no value; in particular it *must not* clamp the values to the expected range. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_uint_by_id(prop: int) -> ~typing.Tuple[bool, int] Like :func:`~gi.repository.Vte.Terminal.get_termprop_uint` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_termprop_value(prop: str) -> ~typing.Tuple[bool, ~gi.repository.GObject.Value] Returns :const:`True` with the value of ``prop`` stored in ``value`` (if not :const:`None`) if, the termprop has a value, or :const:`False` if ``prop`` is unset, or ``prop`` is not a registered property; in that case ``value`` will not be set. The value type returned depends on the termprop type: \* A :const:`~gi.repository.Vte.PropertyType.VALUELESS` termprop stores no value, and returns :const:`False` from this function. \* A :const:`~gi.repository.Vte.PropertyType.BOOL` termprop stores a :obj:`bool` value. \* A :const:`~gi.repository.Vte.PropertyType.INT` termprop stores a :obj:`int` value. \* A :const:`~gi.repository.Vte.PropertyType.UINT` termprop stores a unsigned :obj:`int` value. \* A :const:`~gi.repository.Vte.PropertyType.DOUBLE` termprop stores a :obj:`float` value. \* A :const:`~gi.repository.Vte.PropertyType.RGB` termprop stores a boxed :obj:`~gi.repository.Gdk.RGBA` value with alpha 1.0 on gtk3, and nothing on gtk4. \* A :const:`~gi.repository.Vte.PropertyType.RGBA` termprop stores a boxed :obj:`~gi.repository.Gdk.RGBA` value on gtk3, and nothing on gtk4. \* A :const:`~gi.repository.Vte.PropertyType.STRING` termprop stores a :obj:`str` value. \* A :const:`~gi.repository.Vte.PropertyType.DATA` termprop stores a boxed :obj:`~gi.repository.GLib.Bytes` value. \* A :const:`~gi.repository.Vte.PropertyType.UUID` termprop stores a boxed :obj:`~gi.repository.Vte.Uuid` value. \* A :const:`~gi.repository.Vte.PropertyType.URI` termprop stores a boxed :obj:`~gi.repository.GLib.Uri` value. .. versionadded:: 0.78 :param prop: a termprop name .. method:: get_termprop_value_by_id(prop: int) -> ~typing.Tuple[bool, ~gi.repository.GObject.Value] Like :func:`~gi.repository.Vte.Terminal.get_termprop_value` except that it takes the termprop by ID. See that function for more information. .. versionadded:: 0.78 :param prop: a termprop ID .. method:: get_text(is_selected: ~typing.Callable[[~gi.repository.Vte.Terminal, int, int, ~typing.Any], bool] | None = None, user_data: ~typing.Any = None) -> ~typing.Tuple[str | None, list[~gi.repository.Vte.CharAttributes] | None] Extracts a view of the visible part of the terminal. This method is unaware of BiDi. The columns returned in ``attributes`` are logical columns. Note: since 0.68, passing a non-:const:`None` ``attributes`` parameter is deprecated. Starting with 0.72, passing a non-:const:`None` ``attributes`` parameter will make this function itself return :const:`None`. Since 0.72, passing a non-:const:`None` ``is_selected`` parameter will make this function itself return :const:`None`. .. deprecated:: 0.76 Use :func:`~gi.repository.Vte.Terminal.get_text_format` instead :param is_selected: a :obj:`~gi.repository.Vte.SelectionFunc` callback. Deprecated: 0.44: Always pass :const:`None` here. :param user_data: user data to be passed to the callback .. method:: get_text_blink_mode() -> ~gi.repository.Vte.TextBlinkMode Checks whether or not the terminal will allow blinking text. .. versionadded:: 0.52 .. method:: get_text_format(format: ~gi.repository.Vte.Format) -> str | None Returns text from the visible part of the terminal in the specified format. This method is unaware of BiDi. The columns returned in ``attributes`` are logical columns. .. versionadded:: 0.76 :param format: the :obj:`~gi.repository.Vte.Format` to use .. method:: get_text_include_trailing_spaces(is_selected: ~typing.Callable[[~gi.repository.Vte.Terminal, int, int, ~typing.Any], bool] | None = None, user_data: ~typing.Any = None) -> ~typing.Tuple[str, list[~gi.repository.Vte.CharAttributes] | None] Extracts a view of the visible part of the terminal. This method is unaware of BiDi. The columns returned in ``attributes`` are logical columns. Note: since 0.68, passing a non-:const:`None` ``array`` parameter is deprecated. Starting with 0.72, passing a non-:const:`None` ``array`` parameter will make this function itself return :const:`None`. Since 0.72, passing a non-:const:`None` ``is_selected`` parameter will make this function itself return :const:`None`. .. deprecated:: 0.56 Use :func:`~gi.repository.Vte.Terminal.get_text_format` instead. :param is_selected: a :obj:`~gi.repository.Vte.SelectionFunc` callback. Deprecated: 0.44: Always pass :const:`None` here. :param user_data: user data to be passed to the callback .. method:: get_text_range(start_row: int, start_col: int, end_row: int, end_col: int, is_selected: ~typing.Callable[[~gi.repository.Vte.Terminal, int, int, ~typing.Any], bool] | None = None, user_data: ~typing.Any = None) -> ~typing.Tuple[str | None, list[~gi.repository.Vte.CharAttributes] | None] Extracts a view of the visible part of the terminal. The entire scrollback buffer is scanned, so it is possible to read the entire contents of the buffer using this function. This method is unaware of BiDi. The columns passed in ``start_col`` and ``end_row``\, and returned in ``attributes`` are logical columns. Since 0.68, passing a non-:const:`None` ``array`` parameter is deprecated. Since 0.72, passing a non-:const:`None` ``array`` parameter will make this function itself return :const:`None`. Since 0.72, passing a non-:const:`None` ``is_selected`` function will make this function itself return :const:`None`. .. deprecated:: 0.76 Use :func:`~gi.repository.Vte.Terminal.get_text_range_format` instead :param start_row: first row to search for data :param start_col: first column to search for data :param end_row: last row to search for data :param end_col: last column to search for data :param is_selected: a :obj:`~gi.repository.Vte.SelectionFunc` callback. Deprecated: 0.44: Always pass :const:`None` here :param user_data: user data to be passed to the callback .. method:: get_text_range_format(format: ~gi.repository.Vte.Format, start_row: int, start_col: int, end_row: int, end_col: int) -> ~typing.Tuple[str | None, int] Returns the specified range of text in the specified format. .. versionadded:: 0.72 :param format: the :obj:`~gi.repository.Vte.Format` to use :param start_row: the first row of the range :param start_col: the first column of the range :param end_row: the last row of the range :param end_col: the last column of the range .. method:: get_text_selected(format: ~gi.repository.Vte.Format) -> str | None Gets the currently selected text in the format specified by ``format``\. Since 0.72, this function also supports :const:`~gi.repository.Vte.Format.HTML` format. .. versionadded:: 0.70 :param format: the :obj:`~gi.repository.Vte.Format` to use .. method:: get_text_selected_full(format: ~gi.repository.Vte.Format) -> ~typing.Tuple[str | None, int] Gets the currently selected text in the format specified by ``format``\. .. versionadded:: 0.72 :param format: the :obj:`~gi.repository.Vte.Format` to use .. method:: get_window_title() -> str | None .. deprecated:: 0.78 Use the :const:`~gi.repository.Vte.TERMPROP_XTERM_TITLE` termprop. .. method:: get_word_char_exceptions() -> str | None Returns the set of characters which will be considered parts of a word when doing word-wise selection, in addition to the default which only considers alphanumeric characters part of a word. If :const:`None`, a built-in set is used. .. versionadded:: 0.40 .. method:: get_xalign() -> ~gi.repository.Vte.Align .. versionadded:: 0.76 .. method:: get_xfill() -> bool .. versionadded:: 0.76 .. method:: get_yalign() -> ~gi.repository.Vte.Align .. versionadded:: 0.76 .. method:: get_yfill() -> bool .. versionadded:: 0.76 .. method:: match_add_regex(regex: ~gi.repository.Vte.Regex, flags: int) -> int Adds the regular expression ``regex`` to the list of matching expressions. When the user moves the mouse cursor over a section of displayed text which matches this expression, the text will be highlighted. Note that ``regex`` should have been created using the ``PCRE2_MULTILINE`` flag. .. versionadded:: 0.46 :param regex: a :obj:`~gi.repository.Vte.Regex` :param flags: PCRE2 match flags, or 0 .. method:: match_check(column: int, row: int) -> ~typing.Tuple[str | None, int] Checks if the text in and around the specified position matches any of the regular expressions previously set using vte_terminal_match_add(). If a match exists, the text string is returned and if ``tag`` is not :const:`None`, the number associated with the matched regular expression will be stored in ``tag``\. If more than one regular expression has been set with vte_terminal_match_add(), then expressions are checked in the order in which they were added. .. deprecated:: 0.46 Use vte_terminal_match_check_event() instead. :param column: the text column :param row: the text row .. method:: match_remove(tag: int) -> None Removes the regular expression which is associated with the given ``tag`` from the list of expressions which the terminal will highlight when the user moves the mouse cursor over matching text. :param tag: the tag of the regex to remove .. method:: match_remove_all() -> None Clears the list of regular expressions the terminal uses to highlight text when the user moves the mouse cursor. .. method:: match_set_cursor(tag: int, cursor: ~gi.repository.Gdk.Cursor | None = None) -> None Sets which cursor the terminal will use if the pointer is over the pattern specified by ``tag``\. The terminal keeps a reference to ``cursor``\. .. deprecated:: 0.40 Use :func:`~gi.repository.Vte.Terminal.match_set_cursor_name` instead. :param tag: the tag of the regex which should use the specified cursor :param cursor: the :obj:`~gi.repository.Gdk.Cursor` which the terminal should use when the pattern is highlighted, or :const:`None` to use the standard cursor .. method:: match_set_cursor_name(tag: int, cursor_name: str) -> None Sets which cursor the terminal will use if the pointer is over the pattern specified by ``tag``\. :param tag: the tag of the regex which should use the specified cursor :param cursor_name: the name of the cursor .. method:: paste_clipboard() -> None Sends the contents of the ``GDK_SELECTION_CLIPBOARD`` selection to the terminal's child. It's called on paste menu item, or when user presses Shift+Insert. .. method:: paste_primary() -> None Sends the contents of the ``GDK_SELECTION_PRIMARY`` selection to the terminal's child. The terminal will call also paste the ``GDK_SELECTION_PRIMARY`` selection when the user clicks with the the second mouse button. .. method:: paste_text(text: str) -> None Sends ``text`` to the terminal's child as if retrived from the clipboard, this differs from :func:`~gi.repository.Vte.Terminal.feed_child` in that it may process ``text`` before passing it to the child (e.g. apply bracketed mode) .. versionadded:: 0.68 :param text: a string to paste .. method:: pty_new_sync(flags: ~gi.repository.Vte.PtyFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Vte.Pty Creates a new :obj:`~gi.repository.Vte.Pty`\, sets the emulation property from :obj:`~gi.repository.Vte.Terminal`\:emulation, and sets the size using ``terminal``\'s size. See vte_pty_new() for more information. :param flags: flags from :obj:`~gi.repository.Vte.PtyFlags` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: reset(clear_tabstops: bool, clear_history: bool) -> None Resets as much of the terminal's internal state as possible, discarding any unprocessed input data, resetting character attributes, cursor state, national character set state, status line, terminal modes (insert/delete), selection state, and encoding. :param clear_tabstops: whether to reset tabstops :param clear_history: whether to empty the terminal's scrollback buffer .. method:: search_find_next() -> bool Searches the next string matching the search regex set with :func:`~gi.repository.Vte.Terminal.search_set_regex`. .. method:: search_find_previous() -> bool Searches the previous string matching the search regex set with :func:`~gi.repository.Vte.Terminal.search_set_regex`. .. method:: search_get_regex() -> ~gi.repository.Vte.Regex .. versionadded:: 0.46 .. method:: search_get_wrap_around() -> bool .. method:: search_set_regex(regex: ~gi.repository.Vte.Regex | None, flags: int) -> None Sets the regex to search for. Unsets the search regex when passed :const:`None`. Note that ``regex`` should have been created using the ``PCRE2_MULTILINE`` flag. .. versionadded:: 0.46 :param regex: a :obj:`~gi.repository.Vte.Regex`\, or :const:`None` :param flags: PCRE2 match flags, or 0 .. method:: search_set_wrap_around(wrap_around: bool) -> None Sets whether search should wrap around to the beginning of the terminal content when reaching its end. :param wrap_around: whether search should wrap .. method:: select_all() -> None Selects all text within the terminal (not including the scrollback buffer). .. method:: set_allow_bold(allow_bold: bool) -> None Controls whether or not the terminal will attempt to draw bold text, by using a bold font variant. .. deprecated:: 0.60 There's probably no reason for this feature to exist. :param allow_bold: :const:`True` if the terminal should attempt to draw bold text .. method:: set_allow_hyperlink(allow_hyperlink: bool) -> None Controls whether or not hyperlinks (OSC 8 escape sequence) are allowed. .. versionadded:: 0.50 :param allow_hyperlink: :const:`True` if the terminal should allow hyperlinks .. method:: set_audible_bell(is_audible: bool) -> None Controls whether or not the terminal will beep when the child outputs the "bl" sequence. :param is_audible: :const:`True` if the terminal should beep .. method:: set_backspace_binding(binding: ~gi.repository.Vte.EraseBinding) -> None Modifies the terminal's backspace key binding, which controls what string or control sequence the terminal sends to its child when the user presses the backspace key. :param binding: a :obj:`~gi.repository.Vte.EraseBinding` for the backspace key .. method:: set_bold_is_bright(bold_is_bright: bool) -> None Sets whether the SGR 1 attribute also switches to the bright counterpart of the first 8 palette colors, in addition to making them bold (legacy behavior) or if SGR 1 only enables bold and leaves the color intact. .. versionadded:: 0.52 :param bold_is_bright: :const:`True` if bold should also enable bright .. method:: set_cell_height_scale(scale: float) -> None Sets the terminal's cell height scale to ``scale``\. This can be used to increase the line spacing. (The font's height is not affected.) Valid values go from 1.0 (default) to 2.0 ("double spacing"). .. versionadded:: 0.52 :param scale: the cell height scale .. method:: set_cell_width_scale(scale: float) -> None Sets the terminal's cell width scale to ``scale``\. This can be used to increase the letter spacing. (The font's width is not affected.) Valid values go from 1.0 (default) to 2.0. .. versionadded:: 0.52 :param scale: the cell width scale .. method:: set_cjk_ambiguous_width(width: int) -> None This setting controls whether ambiguous-width characters are narrow or wide. (Note that when using a non-UTF-8 encoding set via :func:`~gi.repository.Vte.Terminal.set_encoding`, the width of ambiguous-width characters is fixed and determined by the encoding itself.) :param width: either 1 (narrow) or 2 (wide) .. method:: set_clear_background(setting: bool) -> None Sets whether to paint the background with the background colour. The default is :const:`True`. This function is rarely useful. One use for it is to add a background image to the terminal. .. versionadded:: 0.52 :param setting: whether to clear the background .. method:: set_color_background(background: ~gi.repository.Gdk.RGBA) -> None Sets the background color for text which does not have a specific background color assigned. Only has effect when no background image is set and when the terminal is not transparent. :param background: the new background color .. method:: set_color_bold(bold: ~gi.repository.Gdk.RGBA | None = None) -> None Sets the color used to draw bold text in the default foreground color. If ``bold`` is :const:`None` then the default color is used. :param bold: the new bold color or :const:`None` .. method:: set_color_cursor(cursor_background: ~gi.repository.Gdk.RGBA | None = None) -> None Sets the background color for text which is under the cursor. If :const:`None`, text under the cursor will be drawn with foreground and background colors reversed. :param cursor_background: the new color to use for the text cursor, or :const:`None` .. method:: set_color_cursor_foreground(cursor_foreground: ~gi.repository.Gdk.RGBA | None = None) -> None Sets the foreground color for text which is under the cursor. If :const:`None`, text under the cursor will be drawn with foreground and background colors reversed. .. versionadded:: 0.44 :param cursor_foreground: the new color to use for the text cursor, or :const:`None` .. method:: set_color_foreground(foreground: ~gi.repository.Gdk.RGBA) -> None Sets the foreground color used to draw normal text. :param foreground: the new foreground color .. method:: set_color_highlight(highlight_background: ~gi.repository.Gdk.RGBA | None = None) -> None Sets the background color for text which is highlighted. If :const:`None`, it is unset. If neither highlight background nor highlight foreground are set, highlighted text (which is usually highlighted because it is selected) will be drawn with foreground and background colors reversed. :param highlight_background: the new color to use for highlighted text, or :const:`None` .. method:: set_color_highlight_foreground(highlight_foreground: ~gi.repository.Gdk.RGBA | None = None) -> None Sets the foreground color for text which is highlighted. If :const:`None`, it is unset. If neither highlight background nor highlight foreground are set, highlighted text (which is usually highlighted because it is selected) will be drawn with foreground and background colors reversed. :param highlight_foreground: the new color to use for highlighted text, or :const:`None` .. method:: set_colors(foreground: ~gi.repository.Gdk.RGBA | None = None, background: ~gi.repository.Gdk.RGBA | None = None, palette: list[~gi.repository.Gdk.RGBA] | None = None) -> None ``palette`` specifies the new values for the 256 palette colors: 8 standard colors, their 8 bright counterparts, 6x6x6 color cube, and 24 grayscale colors. Omitted entries will default to a hardcoded value. ``palette_size`` must be 0, 8, 16, 232 or 256. If ``foreground`` is :const:`None` and ``palette_size`` is greater than 0, the new foreground color is taken from ``palette``\[7]. If ``background`` is :const:`None` and ``palette_size`` is greater than 0, the new background color is taken from ``palette``\[0]. :param foreground: the new foreground color, or :const:`None` :param background: the new background color, or :const:`None` :param palette: the color palette .. method:: set_context_menu(menu: ~gi.repository.Gtk.Widget | None = None) -> None Sets ``menu`` as the context menu in ``terminal``\. Use :const:`None` to unset the current menu. Note that a menu model set with :func:`~gi.repository.Vte.Terminal.set_context_menu_model` takes precedence over a menu set using this function. .. versionadded:: 0.76 :param menu: a menu .. method:: set_context_menu_model(model: ~gi.repository.Gio.MenuModel | None = None) -> None Sets ``model`` as the context menu model in ``terminal``\. Use :const:`None` to unset the current menu model. .. versionadded:: 0.76 :param model: a :obj:`~gi.repository.Gio.MenuModel` .. method:: set_cursor_blink_mode(mode: ~gi.repository.Vte.CursorBlinkMode) -> None Sets whether or not the cursor will blink. Using :const:`~gi.repository.Vte.CursorBlinkMode.SYSTEM` will use the :obj:`~gi.repository.Gtk.Settings`\::gtk-cursor-blink setting. :param mode: the :obj:`~gi.repository.Vte.CursorBlinkMode` to use .. method:: set_cursor_shape(shape: ~gi.repository.Vte.CursorShape) -> None Sets the shape of the cursor drawn. :param shape: the :obj:`~gi.repository.Vte.CursorShape` to use .. method:: set_default_colors() -> None Reset the terminal palette to reasonable compiled-in default color. .. method:: set_delete_binding(binding: ~gi.repository.Vte.EraseBinding) -> None Modifies the terminal's delete key binding, which controls what string or control sequence the terminal sends to its child when the user presses the delete key. :param binding: a :obj:`~gi.repository.Vte.EraseBinding` for the delete key .. method:: set_enable_a11y(enable_a11y: bool) -> None Controls whether or not the terminal will communicate with a11y backends. .. versionadded:: 0.78 :param enable_a11y: :const:`True` to enable a11y support .. method:: set_enable_bidi(enable_bidi: bool) -> None Controls whether or not the terminal will perform bidirectional text rendering. .. versionadded:: 0.58 :param enable_bidi: :const:`True` to enable BiDi support .. method:: set_enable_fallback_scrolling(enable: bool) -> None Controls whether the terminal uses scroll events to scroll the history if the event was not otherwise consumed by it. This function is rarely useful, except when the terminal is added to a :obj:`~gi.repository.Gtk.ScrolledWindow`\, to perform kinetic scrolling (while vte itself does not, yet, implement kinetic scrolling by itself). .. versionadded:: 0.64 :param enable: whether to enable fallback scrolling .. method:: set_enable_legacy_osc777(enable: bool) -> None Sets whether legacy OSC 777 sequences are translated to their corresponding termprops. .. versionadded:: 0.78 :param enable: whether to enable legacy OSC 777 .. method:: set_enable_shaping(enable_shaping: bool) -> None Controls whether or not the terminal will shape Arabic text. .. versionadded:: 0.58 :param enable_shaping: :const:`True` to enable Arabic shaping .. method:: set_enable_sixel(enabled: bool) -> None Set whether to enable SIXEL images. .. versionadded:: 0.62 :param enabled: whether to enable SIXEL images .. method:: set_encoding(codeset: str | None = None) -> bool Changes the encoding the terminal will expect data from the child to be encoded with. For certain terminal types, applications executing in the terminal can change the encoding. If ``codeset`` is :const:`None`, it uses "UTF-8". Note: Support for non-UTF-8 is deprecated and may get removed altogether. Instead of this function, you should use a wrapper like luit(1) when spawning the child process. .. deprecated:: 0.54 Support for non-UTF-8 is deprecated. :param codeset: target charset, or :const:`None` to use UTF-8 .. method:: set_font(font_desc: ~gi.repository.Pango.FontDescription | None = None) -> None Sets the font used for rendering all text displayed by the terminal, overriding any fonts set using gtk_widget_modify_font(). The terminal will immediately attempt to load the desired font, retrieve its metrics, and attempt to resize itself to keep the same number of rows and columns. The font scale is applied to the specified font. :param font_desc: a :obj:`~gi.repository.Pango.FontDescription` for the desired font, or :const:`None` .. method:: set_font_options(font_options: ~gi.repository.cairo.FontOptions | None = None) -> None Sets the terminal's font options to ``options``\. Note that on GTK4, the terminal by default uses font options with %CAIRO_HINT_METRICS_ON set; to override that, use this function to set a :obj:`~gi.repository.cairo.FontOptions` that has %CAIRO_HINT_METRICS_OFF set. .. versionadded:: 0.74 :param font_options: the font options, or :const:`None` .. method:: set_font_scale(scale: float) -> None Sets the terminal's font scale to ``scale``\. :param scale: the font scale .. method:: set_input_enabled(enabled: bool) -> None Enables or disables user input. When user input is disabled, the terminal's child will not receive any key press, or mouse button press or motion events sent to it. :param enabled: whether to enable user input .. method:: set_mouse_autohide(setting: bool) -> None Changes the value of the terminal's mouse autohide setting. When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse. This setting can be read using :func:`~gi.repository.Vte.Terminal.get_mouse_autohide`. :param setting: whether the mouse pointer should autohide .. method:: set_pty(pty: ~gi.repository.Vte.Pty | None = None) -> None Sets ``pty`` as the PTY to use in ``terminal``\. Use :const:`None` to unset the PTY. :param pty: a :obj:`~gi.repository.Vte.Pty`\, or :const:`None` .. method:: set_rewrap_on_resize(rewrap: bool) -> None Controls whether or not the terminal will rewrap its contents, including the scrollback history, whenever the terminal's width changes. .. deprecated:: 0.58 Please do not use it in newly written code :param rewrap: :const:`True` if the terminal should rewrap on resize .. method:: set_scroll_on_insert(scroll: bool) -> None Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when text is inserted, e.g. by a paste. .. versionadded:: 0.76 :param scroll: whether the terminal should scroll on insert .. method:: set_scroll_on_keystroke(scroll: bool) -> None Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. Modifier keys do not trigger this behavior. .. versionadded:: 0.52 :param scroll: whether the terminal should scroll on keystrokes .. method:: set_scroll_on_output(scroll: bool) -> None Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child. .. versionadded:: 0.52 :param scroll: whether the terminal should scroll on output .. method:: set_scroll_unit_is_pixels(enable: bool) -> None Controls whether the terminal's scroll unit is lines or pixels. This function is rarely useful, except when the terminal is added to a :obj:`~gi.repository.Gtk.ScrolledWindow`\. .. versionadded:: 0.66 :param enable: whether to use pixels as scroll unit .. method:: set_scrollback_lines(lines: int) -> None Sets the length of the scrollback buffer used by the terminal. The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback. A negative value means "infinite scrollback". Using a large scrollback buffer (roughly 1M+ lines) may lead to performance degradation or exhaustion of system resources, and is therefore not recommended. Note that this setting only affects the normal screen buffer. No scrollback is allowed on the alternate screen buffer. :param lines: the length of the history buffer .. method:: set_size(columns: int, rows: int) -> None Attempts to change the terminal's size in terms of rows and columns. If the attempt succeeds, the widget will resize itself to the proper size. :param columns: the desired number of columns :param rows: the desired number of rows .. method:: set_suppress_legacy_signals() -> None Suppress emissions of signals and property notifications that are deprecated. .. versionadded:: 0.78 .. method:: set_text_blink_mode(text_blink_mode: ~gi.repository.Vte.TextBlinkMode) -> None Controls whether or not the terminal will allow blinking text. .. versionadded:: 0.52 :param text_blink_mode: the :obj:`~gi.repository.Vte.TextBlinkMode` to use .. method:: set_word_char_exceptions(exceptions: str) -> None With this function you can provide a set of characters which will be considered parts of a word when doing word-wise selection, in addition to the default which only considers alphanumeric characters part of a word. The characters in ``exceptions`` must be non-alphanumeric, each character must occur only once, and if ``exceptions`` contains the character U+002D HYPHEN-MINUS, it must be at the start of the string. Use :const:`None` to reset the set of exception characters to the default. .. versionadded:: 0.40 :param exceptions: a string of ASCII punctuation characters, or :const:`None` .. method:: set_xalign(align: ~gi.repository.Vte.Align) -> None Sets the horizontal alignment of ``terminal`` within its allocation. Note: %VTE_ALIGN_START_FILL is not supported, and will be treated like :const:`~gi.repository.Vte.Align.START`. .. versionadded:: 0.76 :param align: alignment value from :obj:`~gi.repository.Vte.Align` .. method:: set_xfill(fill: bool) -> None Sets the horizontal fillment of ``terminal`` within its allocation. Note: %VTE_FILL_START_FILL is not supported, and will be treated like %VTE_FILL_START. .. versionadded:: 0.76 :param fill: fillment value from ``VteFill`` .. method:: set_yalign(align: ~gi.repository.Vte.Align) -> None Sets the vertical alignment of ``terminal`` within its allocation. .. versionadded:: 0.76 :param align: alignment value from :obj:`~gi.repository.Vte.Align` .. method:: set_yfill(fill: bool) -> None Sets the vertical fillment of ``terminal`` within its allocation. Note that yfill is only supported with yalign set to :const:`~gi.repository.Vte.Align.START`, and is ignored for all other yalign values. .. versionadded:: 0.76 :param fill: fillment value from ``VteFill`` .. method:: spawn_async(pty_flags: ~gi.repository.Vte.PtyFlags, working_directory: str | None, argv: list[str], envv: list[str] | None, spawn_flags: ~gi.repository.GLib.SpawnFlags, child_setup: ~typing.Callable[[~typing.Any], None] | None, timeout: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.Vte.Terminal, int, ~gi.repository.GLib.GError | None, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None A convenience function that wraps creating the :obj:`~gi.repository.Vte.Pty` and spawning the child process on it. Like :func:`~gi.repository.Vte.Terminal.spawn_with_fds_async`, except that this function does not allow passing file descriptors to the child process. See :func:`~gi.repository.Vte.Terminal.spawn_with_fds_async` for more information. .. versionadded:: 0.48 :param pty_flags: flags from :obj:`~gi.repository.Vte.PtyFlags` :param working_directory: the name of a directory the command should start in, or :const:`None` to use the current working directory :param argv: child's argument vector :param envv: a list of environment variables to be added to the environment before starting the process, or :const:`None` :param spawn_flags: flags from :obj:`~gi.repository.GLib.SpawnFlags` :param child_setup: an extra child setup function to run in the child just before exec(), or :const:`None` :param timeout: a timeout value in ms, -1 for the default timeout, or G_MAXINT to wait indefinitely :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: a :obj:`~gi.repository.Vte.TerminalSpawnAsyncCallback`\, or :const:`None` :param user_data: user data for ``callback``\, or :const:`None` .. method:: spawn_sync(pty_flags: ~gi.repository.Vte.PtyFlags, working_directory: str | None, argv: list[str], envv: list[str] | None, spawn_flags: ~gi.repository.GLib.SpawnFlags, child_setup: ~typing.Callable[[~typing.Any], None] | None = None, child_setup_data: ~typing.Any = None, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~typing.Tuple[bool, int] Starts the specified command under a newly-allocated controlling pseudo-terminal. The ``argv`` and ``envv`` lists should be :const:`None`-terminated. The "TERM" environment variable is automatically set to a default value, but can be overridden from ``envv``\. ``pty_flags`` controls logging the session to the specified system log files. Note that %G_SPAWN_DO_NOT_REAP_CHILD will always be added to ``spawn_flags``\. Note also that %G_SPAWN_STDOUT_TO_DEV_NULL, %G_SPAWN_STDERR_TO_DEV_NULL, and %G_SPAWN_CHILD_INHERITS_STDIN are not supported in ``spawn_flags``\, since stdin, stdout and stderr of the child process will always be connected to the PTY. Note that all open file descriptors will be closed in the child. If you want to keep some file descriptor open for use in the child process, you need to use a child setup function that unsets the FD_CLOEXEC flag on that file descriptor. See vte_pty_new(), :func:`~gi.repository.GLib.spawn_async` and :func:`~gi.repository.Vte.Terminal.watch_child` for more information. Beginning with 0.52, sets PWD to ``working_directory`` in order to preserve symlink components. The caller should also make sure that symlinks were preserved while constructing the value of ``working_directory``\, e.g. by using :func:`~gi.repository.Vte.Terminal.get_current_directory_uri`, :func:`~gi.repository.GLib.get_current_dir` or get_current_dir_name(). .. deprecated:: 0.48 Use :func:`~gi.repository.Vte.Terminal.spawn_async` instead. :param pty_flags: flags from :obj:`~gi.repository.Vte.PtyFlags` :param working_directory: the name of a directory the command should start in, or :const:`None` to use the current working directory :param argv: child's argument vector :param envv: a list of environment variables to be added to the environment before starting the process, or :const:`None` :param spawn_flags: flags from :obj:`~gi.repository.GLib.SpawnFlags` :param child_setup: an extra child setup function to run in the child just before exec(), or :const:`None` :param child_setup_data: user data for ``child_setup`` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` .. method:: spawn_with_fds_async(pty_flags: ~gi.repository.Vte.PtyFlags, working_directory: str | None, argv: list[str], envv: list[str] | None, fds: list[int] | None, map_fds: list[int] | None, spawn_flags: ~gi.repository.GLib.SpawnFlags, child_setup: ~typing.Callable[[~typing.Any], None] | None, timeout: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.Vte.Terminal, int, ~gi.repository.GLib.GError | None, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None A convenience function that wraps creating the :obj:`~gi.repository.Vte.Pty` and spawning the child process on it. See :func:`~gi.repository.Vte.Pty.new_sync`, :func:`~gi.repository.Vte.Pty.spawn_with_fds_async`, and :func:`~gi.repository.Vte.Pty.spawn_finish` for more information. When the operation is finished successfully, ``callback`` will be called with the child :obj:`~gi.repository.GLib.Pid`\, and a :const:`None` :obj:`~gi.repository.GLib.Error`\. The child PID will already be watched via :func:`~gi.repository.Vte.Terminal.watch_child`. When the operation fails, ``callback`` will be called with a -1 :obj:`~gi.repository.GLib.Pid`\, and a non-:const:`None` :obj:`~gi.repository.GLib.Error` containing the error information. Note that %G_SPAWN_STDOUT_TO_DEV_NULL, %G_SPAWN_STDERR_TO_DEV_NULL, and %G_SPAWN_CHILD_INHERITS_STDIN are not supported in ``spawn_flags``\, since stdin, stdout and stderr of the child process will always be connected to the PTY. If ``fds`` is not :const:`None`, the child process will map the file descriptors from ``fds`` according to ``map_fds``\; ``n_map_fds`` must be less or equal to ``n_fds``\. This function will take ownership of the file descriptors in ``fds``\; you must not use or close them after this call. Note that all open file descriptors apart from those mapped as above will be closed in the child. (If you want to keep some other file descriptor open for use in the child process, you need to use a child setup function that unsets the FD_CLOEXEC flag on that file descriptor manually.) Beginning with 0.60, and on linux only, and unless :const:`~gi.repository.Vte.SPAWN_NO_SYSTEMD_SCOPE` is passed in ``spawn_flags``\, the newly created child process will be moved to its own systemd user scope; and if :const:`~gi.repository.Vte.SPAWN_REQUIRE_SYSTEMD_SCOPE` is passed, and creation of the systemd user scope fails, the whole spawn will fail. You can override the options used for the systemd user scope by providing a systemd override file for 'vte-spawn-.scope' unit. See man:systemd.unit(5) for further information. Note that if ``terminal`` has been destroyed before the operation is called, ``callback`` will be called with a :const:`None` ``terminal``\; you must not do anything in the callback besides freeing any resources associated with ``user_data``\, but taking care not to access the now-destroyed :obj:`~gi.repository.Vte.Terminal`\. Note that in this case, if spawning was successful, the child process will be aborted automatically. Beginning with 0.52, sets PWD to ``working_directory`` in order to preserve symlink components. The caller should also make sure that symlinks were preserved while constructing the value of ``working_directory``\, e.g. by using :func:`~gi.repository.Vte.Terminal.get_current_directory_uri`, :func:`~gi.repository.GLib.get_current_dir` or get_current_dir_name(). .. versionadded:: 0.62 :param pty_flags: flags from :obj:`~gi.repository.Vte.PtyFlags` :param working_directory: the name of a directory the command should start in, or :const:`None` to use the current working directory :param argv: child's argument vector :param envv: a list of environment variables to be added to the environment before starting the process, or :const:`None` :param fds: an array of file descriptors, or :const:`None` :param map_fds: an array of integers, or :const:`None` :param spawn_flags: flags from :obj:`~gi.repository.GLib.SpawnFlags` :param child_setup: an extra child setup function to run in the child just before exec(), or :const:`None` :param timeout: a timeout value in ms, -1 for the default timeout, or G_MAXINT to wait indefinitely :param cancellable: a :obj:`~gi.repository.Gio.Cancellable`\, or :const:`None` :param callback: a :obj:`~gi.repository.Vte.TerminalSpawnAsyncCallback`\, or :const:`None` :param user_data: user data for ``callback``\, or :const:`None` .. method:: unselect_all() -> None Clears the current selection. .. method:: watch_child(child_pid: int) -> None Watches ``child_pid``\. When the process exists, the :obj:`~gi.repository.Vte.Terminal`\::child-exited signal will be called with the child's exit status. Prior to calling this function, a :obj:`~gi.repository.Vte.Pty` must have been set in ``terminal`` using :func:`~gi.repository.Vte.Terminal.set_pty`. When the child exits, the terminal's :obj:`~gi.repository.Vte.Pty` will be set to :const:`None`. Note: :func:`~gi.repository.GLib.child_watch_add` or :func:`~gi.repository.GLib.child_watch_add_full` must not have been called for ``child_pid``\, nor a :obj:`~gi.repository.GLib.Source` for it been created with :func:`~gi.repository.GLib.child_watch_source_new`. Note: when using the :func:`~gi.repository.GLib.spawn_async` family of functions, the %G_SPAWN_DO_NOT_REAP_CHILD flag MUST have been passed. :param child_pid: a :obj:`~gi.repository.GLib.Pid` .. method:: write_contents_sync(stream: ~gi.repository.Gio.OutputStream, flags: ~gi.repository.Vte.WriteFlags, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool Write contents of the current contents of ``terminal`` (including any scrollback history) to ``stream`` according to ``flags``\. If ``cancellable`` is not :const:`None`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in ``error``\. This is a synchronous operation and will make the widget (and input processing) during the write operation, which may take a long time depending on scrollback history and ``stream`` availability for writing. :param stream: a :obj:`~gi.repository.Gio.OutputStream` to write to :param flags: a set of :obj:`~gi.repository.Vte.WriteFlags` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` object, or :const:`None` Properties ---------- .. rst-class:: interim-class .. class:: Terminal :no-index: .. attribute:: props.allow_bold :type: bool The type of the None singleton. .. deprecated:: 0.60 There's probably no reason for this feature to exist. .. attribute:: props.allow_hyperlink :type: bool The type of the None singleton. .. versionadded:: 0.50 .. attribute:: props.audible_bell :type: bool The type of the None singleton. .. attribute:: props.backspace_binding :type: ~gi.repository.Vte.EraseBinding The type of the None singleton. .. attribute:: props.bold_is_bright :type: bool The type of the None singleton. .. versionadded:: 0.52 .. attribute:: props.cell_height_scale :type: float The type of the None singleton. .. versionadded:: 0.52 .. attribute:: props.cell_width_scale :type: float The type of the None singleton. .. versionadded:: 0.52 .. attribute:: props.cjk_ambiguous_width :type: int The type of the None singleton. .. attribute:: props.context_menu :type: ~gi.repository.Gtk.Popover The type of the None singleton. .. versionadded:: 0.76 .. attribute:: props.context_menu_model :type: ~gi.repository.Gio.MenuModel The type of the None singleton. .. versionadded:: 0.76 .. attribute:: props.current_directory_uri :type: str The type of the None singleton. .. deprecated:: 0.78 Use the :const:`~gi.repository.Vte.TERMPROP_CURRENT_DIRECTORY_URI` termprop. .. attribute:: props.current_file_uri :type: str The type of the None singleton. .. deprecated:: 0.78 Use the :const:`~gi.repository.Vte.TERMPROP_CURRENT_FILE_URI` termprop. .. attribute:: props.cursor_blink_mode :type: ~gi.repository.Vte.CursorBlinkMode The type of the None singleton. .. attribute:: props.cursor_shape :type: ~gi.repository.Vte.CursorShape The type of the None singleton. .. attribute:: props.delete_binding :type: ~gi.repository.Vte.EraseBinding The type of the None singleton. .. attribute:: props.enable_a11y :type: bool The type of the None singleton. .. versionadded:: 0.78 .. attribute:: props.enable_bidi :type: bool The type of the None singleton. .. versionadded:: 0.58 .. attribute:: props.enable_fallback_scrolling :type: bool The type of the None singleton. .. attribute:: props.enable_legacy_osc777 :type: bool The type of the None singleton. .. versionadded:: 0.78 .. attribute:: props.enable_shaping :type: bool The type of the None singleton. .. versionadded:: 0.58 .. attribute:: props.enable_sixel :type: bool The type of the None singleton. .. versionadded:: 0.62 .. attribute:: props.encoding :type: str The type of the None singleton. .. deprecated:: 0.54 Instead of using this, you should use a tool like luit(1) when support for non-UTF-8 is required .. attribute:: props.font_desc :type: ~gi.repository.Pango.FontDescription The type of the None singleton. .. attribute:: props.font_options :type: ~gi.repository.cairo.FontOptions The type of the None singleton. .. versionadded:: 0.74 .. attribute:: props.font_scale :type: float The type of the None singleton. .. attribute:: props.hyperlink_hover_uri :type: str The type of the None singleton. .. versionadded:: 0.50 .. attribute:: props.icon_title :type: str The type of the None singleton. .. deprecated:: 0.54 This property is always :const:`None`. .. attribute:: props.input_enabled :type: bool The type of the None singleton. .. attribute:: props.pointer_autohide :type: bool The type of the None singleton. .. attribute:: props.pty :type: ~gi.repository.Vte.Pty The type of the None singleton. .. attribute:: props.rewrap_on_resize :type: bool The type of the None singleton. .. deprecated:: 0.58 Please do not use it in newly written code .. attribute:: props.scroll_on_insert :type: bool The type of the None singleton. .. versionadded:: 0.76 .. attribute:: props.scroll_on_keystroke :type: bool The type of the None singleton. .. attribute:: props.scroll_on_output :type: bool The type of the None singleton. .. attribute:: props.scroll_unit_is_pixels :type: bool The type of the None singleton. .. versionadded:: 0.66 .. attribute:: props.scrollback_lines :type: int The type of the None singleton. .. attribute:: props.text_blink_mode :type: ~gi.repository.Vte.TextBlinkMode The type of the None singleton. .. versionadded:: 0.52 .. attribute:: props.window_title :type: str The type of the None singleton. .. deprecated:: 0.78 Use the :const:`~gi.repository.Vte.TERMPROP_XTERM_TITLE` termprop. .. attribute:: props.word_char_exceptions :type: str The type of the None singleton. .. versionadded:: 0.40 .. attribute:: props.xalign :type: ~gi.repository.Vte.Align The type of the None singleton. .. versionadded:: 0.76 .. attribute:: props.xfill :type: bool The type of the None singleton. .. versionadded:: 0.76 .. attribute:: props.yalign :type: ~gi.repository.Vte.Align The type of the None singleton. .. versionadded:: 0.76 .. attribute:: props.yfill :type: bool The type of the None singleton. .. versionadded:: 0.76 Signals ------- .. rst-class:: interim-class .. class:: Terminal.signals :no-index: .. method:: bell() -> None The type of the None singleton. .. method:: char_size_changed(width: int, height: int) -> None The type of the None singleton. :param width: the new character cell width :param height: the new character cell height .. method:: child_exited(status: int) -> None The type of the None singleton. :param status: the child's exit status .. method:: commit(text: str, size: int) -> None The type of the None singleton. :param text: a string of text :param size: the length of that string of text .. method:: contents_changed() -> None The type of the None singleton. .. method:: copy_clipboard() -> None The type of the None singleton. .. method:: current_directory_uri_changed() -> None The type of the None singleton. .. deprecated:: 0.78 Use the :obj:`~gi.repository.Vte.Terminal`\:termprop-changed signal for the :const:`~gi.repository.Vte.TERMPROP_CURRENT_DIRECTORY_URI` termprop. .. method:: current_file_uri_changed() -> None The type of the None singleton. .. deprecated:: 0.78 Use the :obj:`~gi.repository.Vte.Terminal`\:termprop-changed signal for the :const:`~gi.repository.Vte.TERMPROP_CURRENT_FILE_URI` termprop. .. method:: cursor_moved() -> None The type of the None singleton. .. method:: decrease_font_size() -> None The type of the None singleton. .. method:: deiconify_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: encoding_changed() -> None The type of the None singleton. .. method:: eof() -> None The type of the None singleton. .. method:: hyperlink_hover_uri_changed(uri: str, bbox: ~gi.repository.Gdk.Rectangle) -> None The type of the None singleton. .. versionadded:: 0.50 :param uri: the nonempty target URI under the mouse, or NULL :param bbox: the bounding box of the hyperlink anchor text, or NULL .. method:: icon_title_changed() -> None The type of the None singleton. .. deprecated:: 0.54 This signal is never emitted. .. method:: iconify_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: increase_font_size() -> None The type of the None singleton. .. method:: lower_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: maximize_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: move_window(x: int, y: int) -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code :param x: the terminal's desired location, X coordinate :param y: the terminal's desired location, Y coordinate .. method:: paste_clipboard() -> None The type of the None singleton. .. method:: raise_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: refresh_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: resize_window(width: int, height: int) -> None The type of the None singleton. :param width: the desired number of columns :param height: the desired number of rows .. method:: restore_window() -> None The type of the None singleton. .. deprecated:: 0.60 Please do not use it in newly written code .. method:: selection_changed() -> None The type of the None singleton. .. method:: setup_context_menu(context: ~gi.repository.Vte.EventContext | None = None) -> None The type of the None singleton. :param context: the context .. method:: termprop_changed(name: str) -> None The type of the None singleton. .. versionadded:: 0.78 :param name: the name of the changed property .. method:: termprops_changed(props: list[int]) -> bool The type of the None singleton. .. versionadded:: 0.78 :param props: an array of termprop IDs .. method:: window_title_changed() -> None The type of the None singleton. .. deprecated:: 0.78 Use the :obj:`~gi.repository.Vte.Terminal`\:termprop-changed signal for the :const:`~gi.repository.Vte.TERMPROP_XTERM_TITLE` termprop. Virtual Methods --------------- .. rst-class:: interim-class .. class:: Terminal :no-index: .. method:: do_bell() -> None The type of the None singleton. .. method:: do_char_size_changed(char_width: int, char_height: int) -> None The type of the None singleton. :param char_width: :param char_height: .. method:: do_child_exited(status: int) -> None The type of the None singleton. :param status: .. method:: do_commit(text: str, size: int) -> None The type of the None singleton. :param text: :param size: .. method:: do_contents_changed() -> None The type of the None singleton. .. method:: do_copy_clipboard() -> None Places the selected text in the terminal in the ``GDK_SELECTION_CLIPBOARD`` selection. .. deprecated:: 0.50 Use :func:`~gi.repository.Vte.Terminal.copy_clipboard_format` with :const:`~gi.repository.Vte.Format.TEXT` instead. .. method:: do_cursor_moved() -> None The type of the None singleton. .. method:: do_decrease_font_size() -> None The type of the None singleton. .. method:: do_deiconify_window() -> None The type of the None singleton. .. method:: do_encoding_changed() -> None The type of the None singleton. .. method:: do_eof() -> None The type of the None singleton. .. method:: do_icon_title_changed() -> None The type of the None singleton. .. method:: do_iconify_window() -> None The type of the None singleton. .. method:: do_increase_font_size() -> None The type of the None singleton. .. method:: do_lower_window() -> None The type of the None singleton. .. method:: do_maximize_window() -> None The type of the None singleton. .. method:: do_move_window(x: int, y: int) -> None The type of the None singleton. :param x: :param y: .. method:: do_paste_clipboard() -> None Sends the contents of the ``GDK_SELECTION_CLIPBOARD`` selection to the terminal's child. It's called on paste menu item, or when user presses Shift+Insert. .. method:: do_raise_window() -> None The type of the None singleton. .. method:: do_refresh_window() -> None The type of the None singleton. .. method:: do_resize_window(width: int, height: int) -> None The type of the None singleton. :param width: :param height: .. method:: do_restore_window() -> None The type of the None singleton. .. method:: do_selection_changed() -> None The type of the None singleton. .. method:: do_setup_context_menu(context: ~gi.repository.Vte.EventContext) -> None The type of the None singleton. :param context: .. method:: do_termprop_changed(prop: str) -> None The type of the None singleton. :param prop: .. method:: do_termprops_changed(props: int, n_props: int) -> bool The type of the None singleton. :param props: :param n_props: .. method:: do_window_title_changed() -> None The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: Terminal :no-index: .. attribute:: widget