Vte.Terminal

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Vte.Terminal Vte.Terminal Gtk.Scrollable->Vte.Terminal Gtk.Widget->Vte.Terminal

Subclasses:

None

Methods

Inherited:

Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)

Structs:

Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

copy_clipboard ()

copy_clipboard_format (format)

copy_primary ()

event_check_gregex_simple (event, regexes, match_flags)

event_check_regex_simple (event, regexes, match_flags)

feed (data)

feed_child (text)

feed_child_binary (data)

get_allow_bold ()

get_allow_hyperlink ()

get_audible_bell ()

get_bold_is_bright ()

get_cell_height_scale ()

get_cell_width_scale ()

get_char_height ()

get_char_width ()

get_cjk_ambiguous_width ()

get_color_background_for_draw ()

get_column_count ()

get_context_menu ()

get_context_menu_model ()

get_current_directory_uri ()

get_current_file_uri ()

get_cursor_blink_mode ()

get_cursor_position ()

get_cursor_shape ()

get_enable_bidi ()

get_enable_fallback_scrolling ()

get_enable_shaping ()

get_enable_sixel ()

get_encoding ()

get_font ()

get_font_options ()

get_font_scale ()

get_geometry_hints (min_rows, min_columns)

get_has_selection ()

get_icon_title ()

get_input_enabled ()

get_mouse_autohide ()

get_pty ()

get_rewrap_on_resize ()

get_row_count ()

get_scroll_on_insert ()

get_scroll_on_keystroke ()

get_scroll_on_output ()

get_scroll_unit_is_pixels ()

get_scrollback_lines ()

get_text (is_selected, *user_data)

get_text_blink_mode ()

get_text_format (format)

get_text_include_trailing_spaces (is_selected, *user_data)

get_text_range (start_row, start_col, end_row, end_col, is_selected, *user_data)

get_text_range_format (format, start_row, start_col, end_row, end_col)

get_text_selected (format)

get_text_selected_full (format)

get_window_title ()

get_word_char_exceptions ()

get_xalign ()

get_xfill ()

get_yalign ()

get_yfill ()

hyperlink_check_event (event)

match_add_gregex (gregex, gflags)

match_add_regex (regex, flags)

match_check (column, row)

match_check_event (event)

match_remove (tag)

match_remove_all ()

match_set_cursor (tag, cursor)

match_set_cursor_name (tag, cursor_name)

match_set_cursor_type (tag, cursor_type)

paste_clipboard ()

paste_primary ()

paste_text (text)

pty_new_sync (flags, cancellable)

reset (clear_tabstops, clear_history)

search_find_next ()

search_find_previous ()

search_get_gregex ()

search_get_regex ()

search_get_wrap_around ()

search_set_gregex (gregex, gflags)

search_set_regex (regex, flags)

search_set_wrap_around (wrap_around)

select_all ()

set_allow_bold (allow_bold)

set_allow_hyperlink (allow_hyperlink)

set_audible_bell (is_audible)

set_backspace_binding (binding)

set_bold_is_bright (bold_is_bright)

set_cell_height_scale (scale)

set_cell_width_scale (scale)

set_cjk_ambiguous_width (width)

set_clear_background (setting)

set_color_background (background)

set_color_bold (bold)

set_color_cursor (cursor_background)

set_color_cursor_foreground (cursor_foreground)

set_color_foreground (foreground)

set_color_highlight (highlight_background)

set_color_highlight_foreground (highlight_foreground)

set_colors (foreground, background, palette)

set_context_menu (menu)

set_context_menu_model (model)

set_cursor_blink_mode (mode)

set_cursor_shape (shape)

set_default_colors ()

set_delete_binding (binding)

set_enable_bidi (enable_bidi)

set_enable_fallback_scrolling (enable)

set_enable_shaping (enable_shaping)

set_enable_sixel (enabled)

set_encoding (codeset)

set_font (font_desc)

set_font_options (font_options)

set_font_scale (scale)

set_geometry_hints_for_window (window)

set_input_enabled (enabled)

set_mouse_autohide (setting)

set_pty (pty)

set_rewrap_on_resize (rewrap)

set_scroll_on_insert (scroll)

set_scroll_on_keystroke (scroll)

set_scroll_on_output (scroll)

set_scroll_unit_is_pixels (enable)

set_scrollback_lines (lines)

set_size (columns, rows)

set_text_blink_mode (text_blink_mode)

set_word_char_exceptions (exceptions)

set_xalign (align)

set_xfill (fill)

set_yalign (align)

set_yfill (fill)

spawn_async (pty_flags, working_directory, argv, envv, spawn_flags, child_setup, timeout, cancellable, callback, *user_data)

spawn_sync (pty_flags, working_directory, argv, envv, spawn_flags, child_setup, child_setup_data, cancellable)

spawn_with_fds_async (pty_flags, working_directory, argv, envv, fds, map_fds, spawn_flags, child_setup, timeout, cancellable, callback, *user_data)

unselect_all ()

watch_child (child_pid)

write_contents_sync (stream, flags, cancellable)

Virtual Methods

Inherited:

Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Scrollable (1)

do_bell ()

do_char_size_changed (char_width, char_height)

do_child_exited (status)

do_commit (text, size)

do_contents_changed ()

do_copy_clipboard ()

do_cursor_moved ()

do_decrease_font_size ()

do_deiconify_window ()

do_encoding_changed ()

do_eof ()

do_icon_title_changed ()

do_iconify_window ()

do_increase_font_size ()

do_lower_window ()

do_maximize_window ()

do_move_window (x, y)

do_paste_clipboard ()

do_raise_window ()

do_refresh_window ()

do_resize_window (width, height)

do_restore_window ()

do_selection_changed ()

do_setup_context_menu (context)

do_text_deleted ()

do_text_inserted ()

do_text_modified ()

do_text_scrolled (delta)

do_window_title_changed ()

Properties

Inherited:

Gtk.Widget (39), Gtk.Scrollable (4)

Name

Type

Flags

Short Description

allow-bold

bool

r/w/en

deprecated

allow-hyperlink

bool

r/w/en

audible-bell

bool

r/w/en

backspace-binding

Vte.EraseBinding

r/w/en

bold-is-bright

bool

r/w/en

cell-height-scale

float

r/w/en

cell-width-scale

float

r/w/en

cjk-ambiguous-width

int

r/w/en

context-menu

Gtk.Menu

r/w/en

context-menu-model

Gio.MenuModel

r/w/en

current-directory-uri

str

r/en

current-file-uri

str

r/en

cursor-blink-mode

Vte.CursorBlinkMode

r/w/en

cursor-shape

Vte.CursorShape

r/w/en

delete-binding

Vte.EraseBinding

r/w/en

enable-bidi

bool

r/w/en

enable-fallback-scrolling

bool

r/w/en

enable-shaping

bool

r/w/en

enable-sixel

bool

r/w/en

encoding

str

r/w/en

deprecated

font-desc

Pango.FontDescription

r/w/en

font-options

cairo.FontOptions

r/w/en

font-scale

float

r/w/en

hyperlink-hover-uri

str

r/en

icon-title

str

r/en

deprecated

input-enabled

bool

r/w/en

pointer-autohide

bool

r/w/en

pty

Vte.Pty

r/w/en

rewrap-on-resize

bool

r/w/en

deprecated

scroll-on-insert

bool

r/w/en

scroll-on-keystroke

bool

r/w/en

scroll-on-output

bool

r/w/en

scroll-unit-is-pixels

bool

r/w/en

scrollback-lines

int

r/w/en

text-blink-mode

Vte.TextBlinkMode

r/w/en

window-title

str

r/en

word-char-exceptions

str

r/en

xalign

Vte.Align

r/w/en

xfill

bool

r/w/en

yalign

Vte.Align

r/w/en

yfill

bool

r/w/en

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Widget (69), GObject.Object (1)

Name

Short Description

bell

This signal is emitted when the a child sends a bell request to the terminal.

char-size-changed

Emitted whenever the cell size changes, e.g.

child-exited

This signal is emitted when the terminal detects that a child watched using Vte.Terminal.watch_child() has exited.

commit

Emitted whenever the terminal receives input from the user and prepares to send it to the child process.

contents-changed

Emitted whenever the visible appearance of the terminal has changed.

copy-clipboard

Emitted whenever Vte.Terminal.copy_clipboard() is called.

current-directory-uri-changed

Emitted when the current directory URI is modified.

current-file-uri-changed

Emitted when the current file URI is modified.

cursor-moved

Emitted whenever the cursor moves to a new character cell.

decrease-font-size

Emitted when the user hits the ‘-’ key while holding the Control key.

deiconify-window

Never emitted. deprecated

encoding-changed

Emitted whenever the terminal’s current encoding has changed.

eof

Emitted when the terminal receives an end-of-file from a child which is running in the terminal.

hyperlink-hover-uri-changed

Emitted when the hovered hyperlink changes.

icon-title-changed

deprecated

iconify-window

Never emitted. deprecated

increase-font-size

Emitted when the user hits the ‘+’ key while holding the Control key.

lower-window

Never emitted. deprecated

maximize-window

Never emitted. deprecated

move-window

Never emitted. deprecated

paste-clipboard

Emitted whenever Vte.Terminal.paste_clipboard() is called.

raise-window

Never emitted. deprecated

refresh-window

Never emitted. deprecated

resize-window

Emitted at the child application’s request.

restore-window

Never emitted. deprecated

selection-changed

Emitted whenever the contents of terminal’s selection changes.

setup-context-menu

Emitted with non-None context before terminal shows a context menu.

text-deleted

deprecated

text-inserted

deprecated

text-modified

deprecated

text-scrolled

deprecated

window-title-changed

Emitted when the Vte.Terminal :window-title property is modified.

Fields

Inherited:

Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

widget

Gtk.Widget

r

Class Details

class Vte.Terminal(**kwargs)
Bases:

Gtk.Widget, Gtk.Scrollable

Abstract:

No

Structure:

Vte.TerminalClass

classmethod new()
Returns:

a new Vte.Terminal object

Return type:

Vte.Terminal

Creates a new terminal widget.

copy_clipboard()

Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD selection.

Deprecated since version 0.50: Use Vte.Terminal.copy_clipboard_format() with Vte.Format.TEXT instead.

copy_clipboard_format(format)
Parameters:

format (Vte.Format) – a Vte.Format

Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD selection in the form specified by format.

For all formats, the selection data (see Gtk.SelectionData) will include the text targets (see Gtk.TargetList.add_text_targets() and gtk_selection_data_targets_includes_text()). For Vte.Format.HTML, the selection will also include the “text/html” target, which when requested, returns the HTML data in UTF-16 with a U+FEFF BYTE ORDER MARK character at the start.

New in version 0.50.

copy_primary()

Places the selected text in the terminal in the #GDK_SELECTION_PRIMARY selection.

event_check_gregex_simple(event, regexes, match_flags)
Parameters:
Returns:

False

matches:

a location to store the matches

Return type:

(bool, matches: [str])

This function does nothing.

New in version 0.44.

Deprecated since version 0.46: Use Vte.Terminal.event_check_regex_simple() instead.

event_check_regex_simple(event, regexes, match_flags)
Parameters:
Returns:

a newly allocated array of strings, or None if none of the regexes matched

Return type:

[str] or None

Like Vte.Terminal.event_check_regex_simple(), but returns an array of strings, containing the matching text (or None if no match) corresponding to each of the regexes in regexes.

You must free each string and the array; but note that this is *not* a None-terminated string array, and so you must *not* use GLib.strfreev() on it.

New in version 0.62.

feed(data)
Parameters:

data (bytes or None) – a string in the terminal’s current encoding

Interprets data as if it were data received from a child process.

feed_child(text)
Parameters:

text (bytes or None) – data to send to the child

Sends a block of UTF-8 text to the child as if it were entered by the user at the keyboard.

feed_child_binary(data)
Parameters:

data (bytes or None) – data to send to the child

Sends a block of binary data to the child.

Deprecated since version 0.60: Don’t send binary data. Use Vte.Terminal.feed_child() instead to send UTF-8 text

get_allow_bold()
Returns:

True if bolding is enabled, False if not

Return type:

bool

Checks whether or not the terminal will attempt to draw bold text, by using a bold font variant.

Deprecated since version 0.60: There’s probably no reason for this feature to exist.

Returns:

True if hyperlinks are enabled, False if not

Return type:

bool

Checks whether or not hyperlinks (OSC 8 escape sequence) are allowed.

New in version 0.50.

get_audible_bell()
Returns:

True if audible bell is enabled, False if not

Return type:

bool

Checks whether or not the terminal will beep when the child outputs the “bl” sequence.

get_bold_is_bright()
Returns:

True if bold also enables bright, False if not

Return type:

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.

New in version 0.52.

get_cell_height_scale()
Returns:

the terminal’s cell height scale

Return type:

float

New in version 0.52.

get_cell_width_scale()
Returns:

the terminal’s cell width scale

Return type:

float

New in version 0.52.

get_char_height()
Returns:

the height of a character cell

Note that this method should rather be called vte_terminal_get_cell_height, because the return value takes cell-height-scale into account.

Return type:

int

get_char_width()
Returns:

the width of a character cell

Note that this method should rather be called vte_terminal_get_cell_width, because the return value takes cell-width-scale into account.

Return type:

int

get_cjk_ambiguous_width()
Returns:

1 if ambiguous-width characters are narrow, or 2 if they are wide

Return type:

int

Returns whether ambiguous-width characters are narrow or wide. (Note that when using a non-UTF-8 encoding set via Vte.Terminal.set_encoding(), the width of ambiguous-width characters is fixed and determined by the encoding itself.)

get_color_background_for_draw()
Returns:

a location to store a Gdk.RGBA color

Return type:

color: Gdk.RGBA

Returns the background colour, as used by self when drawing the background, which may be different from the color set by Vte.Terminal.set_color_background().

Note: you must only call this function while handling the Gtk.Widget ::draw signal.

This function is rarely useful. One use for it is if you disable drawing the background (see Vte.Terminal.set_clear_background()) and then need to draw the background yourself.

New in version 0.54.

get_column_count()
Returns:

the number of columns

Return type:

int

get_context_menu()
Returns:

the context menu, or None

Return type:

Gtk.Widget or None

New in version 0.76.

get_context_menu_model()
Returns:

the context menu model, or None

Return type:

Gio.MenuModel or None

New in version 0.76.

get_current_directory_uri()
Returns:

the URI of the current directory of the process running in the terminal, or None

Return type:

str or None

get_current_file_uri()
Returns:

the URI of the current file the process running in the terminal is operating on, or None if not set

Return type:

str or None

Returns:

cursor blink mode.

Return type:

Vte.CursorBlinkMode

Returns the currently set cursor blink mode.

get_cursor_position()
Returns:

column:

a location to store the column, or None

row:

a location to store the row, or None

Return type:

(column: int, row: 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.

get_cursor_shape()
Returns:

cursor shape.

Return type:

Vte.CursorShape

Returns the currently set cursor shape.

get_enable_bidi()
Returns:

True if BiDi is enabled, False if not

Return type:

bool

Checks whether the terminal performs bidirectional text rendering.

New in version 0.58.

get_enable_fallback_scrolling()
Returns:

True if fallback scrolling is enabled

Return type:

bool

New in version 0.64.

get_enable_shaping()
Returns:

True if Arabic shaping is enabled, False if not

Return type:

bool

Checks whether the terminal shapes Arabic text.

New in version 0.58.

get_enable_sixel()
Returns:

False

Return type:

bool

New in version 0.62.

get_encoding()
Returns:

the current encoding for the terminal

Return type:

str or None

Determines the name of the encoding in which the terminal expects data to be encoded, or None if UTF-8 is in use.

Deprecated since version 0.54: Support for non-UTF-8 is deprecated.

get_font()
Returns:

a Pango.FontDescription describing the font the terminal uses to render text at the default font scale of 1.0.

Return type:

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.

get_font_options()
Returns:

the terminal’s font options, or None

Return type:

cairo.FontOptions or None

New in version 0.74.

get_font_scale()
Returns:

the terminal’s font scale

Return type:

float

get_geometry_hints(min_rows, min_columns)
Parameters:
  • min_rows (int) – the minimum number of rows to request

  • min_columns (int) – the minimum number of columns to request

Returns:

a Gdk.Geometry to fill in

Return type:

hints: Gdk.Geometry

Fills in some hints from self's geometry. The hints filled are those covered by the Gdk.WindowHints.RESIZE_INC, Gdk.WindowHints.MIN_SIZE and Gdk.WindowHints.BASE_SIZE flags.

See Gtk.Window.set_geometry_hints() for more information.

self must be realized (see Gtk.Widget.get_realized()).

Deprecated since version 0.52.

get_has_selection()
Returns:

True if part of the text in the terminal is selected.

Return type:

bool

Checks if the terminal currently contains selected text. Note that this is different from determining if the terminal is the owner of any Gtk.Clipboard items.

get_icon_title()
Returns:

None

Return type:

str or None

Deprecated since version 0.54.

get_input_enabled()
Return type:

bool

Returns whether the terminal allow user input.

get_mouse_autohide()
Returns:

True if autohiding is enabled, False if not

Return type:

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 Vte.Terminal.set_mouse_autohide().

get_pty()
Returns:

a Vte.Pty, or None

Return type:

Vte.Pty

Returns the Vte.Pty of self.

get_rewrap_on_resize()
Returns:

True if rewrapping is enabled, False if not

Return type:

bool

Checks whether or not the terminal will rewrap its contents upon resize.

Deprecated since version 0.58.

get_row_count()
Returns:

the number of rows

Return type:

int

get_scroll_on_insert()
Returns:

whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.

Return type:

bool

New in version 0.76.

get_scroll_on_keystroke()
Returns:

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.

Return type:

bool

New in version 0.52.

get_scroll_on_output()
Returns:

whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.

Return type:

bool

New in version 0.52.

get_scroll_unit_is_pixels()
Returns:

True if the scroll unit is pixels; or False if the unit is lines

Return type:

bool

New in version 0.66.

get_scrollback_lines()
Returns:

length of the scrollback buffer used by the terminal. A negative value means “infinite scrollback”.

Return type:

int

New in version 0.52.

get_text(is_selected, *user_data)
Parameters:
Returns:

a newly allocated text string, or None.

attributes:

location for storing text attributes. Deprecated: 0.68: Always pass None here.

Return type:

(str or None, attributes: [Vte.CharAttributes])

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-None attributes parameter is deprecated. Starting with 0.72, passing a non-None attributes parameter will make this function itself return None. Since 0.72, passing a non-None is_selected parameter will make this function itself return None.

Deprecated since version 0.76: Use Vte.Terminal.get_text_format() instead

Returns:

the blinking setting

Return type:

Vte.TextBlinkMode

Checks whether or not the terminal will allow blinking text.

New in version 0.52.

get_text_format(format)
Parameters:

format (Vte.Format) – the Vte.Format to use

Returns:

a newly allocated text string, or None.

Return type:

str or 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.

New in version 0.76.

get_text_include_trailing_spaces(is_selected, *user_data)
Parameters:
Returns:

a newly allocated text string, or None.

attributes:

location for storing text attributes. Deprecated: 0.68: Always pass None here.

Return type:

(str, attributes: [Vte.CharAttributes])

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-None array parameter is deprecated. Starting with 0.72, passing a non-None array parameter will make this function itself return None. Since 0.72, passing a non-None is_selected parameter will make this function itself return None.

Deprecated since version 0.56: Use Vte.Terminal.get_text_format() instead.

get_text_range(start_row, start_col, end_row, end_col, is_selected, *user_data)
Parameters:
  • start_row (int) – first row to search for data

  • start_col (int) – first column to search for data

  • end_row (int) – last row to search for data

  • end_col (int) – last column to search for data

  • is_selected (Vte.SelectionFunc or None) – a Vte.SelectionFunc callback. Deprecated: 0.44: Always pass None here

  • user_data (object or None) – user data to be passed to the callback

Returns:

a newly allocated text string, or None.

attributes:

location for storing text attributes. Deprecated: 0.68: Always pass None here.

Return type:

(str or None, attributes: [Vte.CharAttributes])

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-None array parameter is deprecated. Since 0.72, passing a non-None array parameter will make this function itself return None. Since 0.72, passing a non-None is_selected function will make this function itself return None.

Deprecated since version 0.76: Use Vte.Terminal.get_text_range_format() instead

get_text_range_format(format, start_row, start_col, end_row, end_col)
Parameters:
  • format (Vte.Format) – the Vte.Format to use

  • start_row (int) – the first row of the range

  • start_col (int) – the first column of the range

  • end_row (int) – the last row of the range

  • end_col (int) – the last column of the range

Returns:

a newly allocated string, or None.

length:

a pointer to a #gsize to store the string length

Return type:

(str or None, length: int)

Returns the specified range of text in the specified format.

New in version 0.72.

get_text_selected(format)
Parameters:

format (Vte.Format) – the Vte.Format to use

Returns:

a newly allocated string containing the selected text, or None if there is no selection or the format is not supported

Return type:

str or None

Gets the currently selected text in the format specified by format. Since 0.72, this function also supports Vte.Format.HTML format.

New in version 0.70.

get_text_selected_full(format)
Parameters:

format (Vte.Format) – the Vte.Format to use

Returns:

a newly allocated string containing the selected text, or None if there is no selection or the format is not supported

length:

a pointer to a #gsize to store the string length

Return type:

(str or None, length: int)

Gets the currently selected text in the format specified by format.

New in version 0.72.

get_window_title()
Returns:

the window title, or None

Return type:

str or None

get_word_char_exceptions()
Returns:

a string, or None

Return type:

str or 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 None, a built-in set is used.

New in version 0.40.

get_xalign()
Returns:

the horizontal alignment of self within its allocation

Return type:

Vte.Align

New in version 0.76.

get_xfill()
Returns:

the horizontal fillment of self within its allocation

Return type:

bool

New in version 0.76.

get_yalign()
Returns:

the vertical alignment of self within its allocation

Return type:

Vte.Align

New in version 0.76.

get_yfill()
Returns:

the vertical fillment of self within its allocation

Return type:

bool

New in version 0.76.

Parameters:

event (Gdk.Event) – a Gdk.Event

Returns:

a newly allocated string containing the target of the hyperlink, or None

Return type:

str or None

Returns a nonempty string: the target of the explicit hyperlink (printed using the OSC 8 escape sequence) at the position of the event, or 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.

New in version 0.50.

match_add_gregex(gregex, gflags)
Parameters:
Returns:

-1

Return type:

int

This function does nothing since version 0.60.

Deprecated since version 0.46: Use Vte.Terminal.match_add_regex() instead.

match_add_regex(regex, flags)
Parameters:
Returns:

an integer associated with this expression

Return type:

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.

New in version 0.46.

match_check(column, row)
Parameters:
  • column (int) – the text column

  • row (int) – the text row

Returns:

a newly allocated string which matches one of the previously set regular expressions

tag:

a location to store the tag, or None

Return type:

(str or None, tag: 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 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 since version 0.46: Use Vte.Terminal.match_check_event() instead.

match_check_event(event)
Parameters:

event (Gdk.Event) – a Gdk.Event

Returns:

a newly allocated string which matches one of the previously set regular expressions, or None if there is no match

tag:

a location to store the tag, or None

Return type:

(str or None, tag: int)

Checks if the text in and around the position of the event 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 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.

match_remove(tag)
Parameters:

tag (int) – the tag of the regex to remove

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.

match_remove_all()

Clears the list of regular expressions the terminal uses to highlight text when the user moves the mouse cursor.

match_set_cursor(tag, cursor)
Parameters:
  • tag (int) – the tag of the regex which should use the specified cursor

  • cursor (Gdk.Cursor or None) – the Gdk.Cursor which the terminal should use when the pattern is highlighted, or None to use the standard cursor

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 since version 0.40: Use Vte.Terminal.match_set_cursor_name() instead.

match_set_cursor_name(tag, cursor_name)
Parameters:
  • tag (int) – the tag of the regex which should use the specified cursor

  • cursor_name (str) – the name of the cursor

Sets which cursor the terminal will use if the pointer is over the pattern specified by tag.

match_set_cursor_type(tag, cursor_type)
Parameters:

Sets which cursor the terminal will use if the pointer is over the pattern specified by tag.

Deprecated since version 0.54: Use Vte.Terminal.match_set_cursor_name() instead.

paste_clipboard()

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.

paste_primary()

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.

paste_text(text)
Parameters:

text (str) – a string to paste

Sends text to the terminal’s child as if retrived from the clipboard, this differs from Vte.Terminal.feed_child() in that it may process text before passing it to the child (e.g. apply bracketed mode)

New in version 0.68.

pty_new_sync(flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a new Vte.Pty

Return type:

Vte.Pty

Creates a new Vte.Pty, sets the emulation property from Vte.Terminal :emulation, and sets the size using self's size.

See vte_pty_new() for more information.

reset(clear_tabstops, clear_history)
Parameters:
  • clear_tabstops (bool) – whether to reset tabstops

  • clear_history (bool) – whether to empty the terminal’s scrollback buffer

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.

search_find_next()
Returns:

True if a match was found

Return type:

bool

Searches the next string matching the search regex set with Vte.Terminal.search_set_regex().

search_find_previous()
Returns:

True if a match was found

Return type:

bool

Searches the previous string matching the search regex set with Vte.Terminal.search_set_regex().

search_get_gregex()
Returns:

None

Return type:

GLib.Regex

Deprecated since version 0.46: use Vte.Terminal.search_get_regex() instead.

search_get_regex()
Returns:

the search Vte.Regex regex set in self, or None

Return type:

Vte.Regex

New in version 0.46.

search_get_wrap_around()
Returns:

whether searching will wrap around

Return type:

bool

search_set_gregex(gregex, gflags)
Parameters:

This function does nothing since version 0.60.

Deprecated since version 0.46: use Vte.Terminal.search_set_regex() instead.

search_set_regex(regex, flags)
Parameters:

Sets the regex to search for. Unsets the search regex when passed None.

Note that regex should have been created using the PCRE2_MULTILINE flag.

New in version 0.46.

search_set_wrap_around(wrap_around)
Parameters:

wrap_around (bool) – whether search should wrap

Sets whether search should wrap around to the beginning of the terminal content when reaching its end.

select_all()

Selects all text within the terminal (not including the scrollback buffer).

set_allow_bold(allow_bold)
Parameters:

allow_bold (bool) – True if the terminal should attempt to draw bold text

Controls whether or not the terminal will attempt to draw bold text, by using a bold font variant.

Deprecated since version 0.60: There’s probably no reason for this feature to exist.

Parameters:

allow_hyperlink (bool) – True if the terminal should allow hyperlinks

Controls whether or not hyperlinks (OSC 8 escape sequence) are allowed.

New in version 0.50.

set_audible_bell(is_audible)
Parameters:

is_audible (bool) – True if the terminal should beep

Controls whether or not the terminal will beep when the child outputs the “bl” sequence.

set_backspace_binding(binding)
Parameters:

binding (Vte.EraseBinding) – a Vte.EraseBinding for the backspace key

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.

set_bold_is_bright(bold_is_bright)
Parameters:

bold_is_bright (bool) – True if bold should also enable bright

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.

New in version 0.52.

set_cell_height_scale(scale)
Parameters:

scale (float) – the cell height scale

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”).

New in version 0.52.

set_cell_width_scale(scale)
Parameters:

scale (float) – the cell width scale

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.

New in version 0.52.

set_cjk_ambiguous_width(width)
Parameters:

width (int) – either 1 (narrow) or 2 (wide)

This setting controls whether ambiguous-width characters are narrow or wide. (Note that when using a non-UTF-8 encoding set via Vte.Terminal.set_encoding(), the width of ambiguous-width characters is fixed and determined by the encoding itself.)

set_clear_background(setting)
Parameters:

setting (bool) – whether to clear the background

Sets whether to paint the background with the background colour. The default is True.

This function is rarely useful. One use for it is to add a background image to the terminal.

New in version 0.52.

set_color_background(background)
Parameters:

background (Gdk.RGBA) – the new background color

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.

set_color_bold(bold)
Parameters:

bold (Gdk.RGBA or None) – the new bold color or None

Sets the color used to draw bold text in the default foreground color. If bold is None then the default color is used.

set_color_cursor(cursor_background)
Parameters:

cursor_background (Gdk.RGBA or None) – the new color to use for the text cursor, or None

Sets the background color for text which is under the cursor. If None, text under the cursor will be drawn with foreground and background colors reversed.

set_color_cursor_foreground(cursor_foreground)
Parameters:

cursor_foreground (Gdk.RGBA or None) – the new color to use for the text cursor, or None

Sets the foreground color for text which is under the cursor. If None, text under the cursor will be drawn with foreground and background colors reversed.

New in version 0.44.

set_color_foreground(foreground)
Parameters:

foreground (Gdk.RGBA) – the new foreground color

Sets the foreground color used to draw normal text.

set_color_highlight(highlight_background)
Parameters:

highlight_background (Gdk.RGBA or None) – the new color to use for highlighted text, or None

Sets the background color for text which is highlighted. If 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.

set_color_highlight_foreground(highlight_foreground)
Parameters:

highlight_foreground (Gdk.RGBA or None) – the new color to use for highlighted text, or None

Sets the foreground color for text which is highlighted. If 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.

set_colors(foreground, background, palette)
Parameters:

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 None and palette_size is greater than 0, the new foreground color is taken from palette[7]. If background is None and palette_size is greater than 0, the new background color is taken from palette[0].

set_context_menu(menu)
Parameters:

menu (Gtk.Widget or None) – a menu

Sets menu as the context menu in self. Use None to unset the current menu.

Note that a menu model set with Vte.Terminal.set_context_menu_model() takes precedence over a menu set using this function.

New in version 0.76.

set_context_menu_model(model)
Parameters:

model (Gio.MenuModel or None) – a Gio.MenuModel

Sets model as the context menu model in self. Use None to unset the current menu model.

New in version 0.76.

Parameters:

mode (Vte.CursorBlinkMode) – the Vte.CursorBlinkMode to use

Sets whether or not the cursor will blink. Using Vte.CursorBlinkMode.SYSTEM will use the Gtk.Settings ::gtk-cursor-blink setting.

set_cursor_shape(shape)
Parameters:

shape (Vte.CursorShape) – the Vte.CursorShape to use

Sets the shape of the cursor drawn.

set_default_colors()

Reset the terminal palette to reasonable compiled-in default color.

set_delete_binding(binding)
Parameters:

binding (Vte.EraseBinding) – a Vte.EraseBinding for the delete key

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.

set_enable_bidi(enable_bidi)
Parameters:

enable_bidi (bool) – True to enable BiDi support

Controls whether or not the terminal will perform bidirectional text rendering.

New in version 0.58.

set_enable_fallback_scrolling(enable)
Parameters:

enable (bool) – whether to enable fallback scrolling

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 Gtk.ScrolledWindow, to perform kinetic scrolling (while vte itself does not, yet, implement kinetic scrolling by itself).

New in version 0.64.

set_enable_shaping(enable_shaping)
Parameters:

enable_shaping (bool) – True to enable Arabic shaping

Controls whether or not the terminal will shape Arabic text.

New in version 0.58.

set_enable_sixel(enabled)
Parameters:

enabled (bool) – whether to enable SIXEL images

Set whether to enable SIXEL images.

New in version 0.62.

set_encoding(codeset)
Parameters:

codeset (str or None) – target charset, or None to use UTF-8

Raises:

GLib.Error

Returns:

True if the encoding could be changed to the specified one, or False with error set to GLib.ConvertError.NO_CONVERSION.

Return type:

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 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 since version 0.54: Support for non-UTF-8 is deprecated.

set_font(font_desc)
Parameters:

font_desc (Pango.FontDescription or None) – a Pango.FontDescription for the desired font, or 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.

set_font_options(font_options)
Parameters:

font_options (cairo.FontOptions or None) – the font options, or None

Sets the terminal’s font options to options.

Note that on GTK4, the terminal by default uses font options with cairo.HintMetrics.ON set; to override that, use this function to set a cairo.FontOptions that has cairo.HintMetrics.OFF set.

New in version 0.74.

set_font_scale(scale)
Parameters:

scale (float) – the font scale

Sets the terminal’s font scale to scale.

set_geometry_hints_for_window(window)
Parameters:

window (Gtk.Window) – a Gtk.Window

Sets self as window's geometry widget. See Gtk.Window.set_geometry_hints() for more information.

self must be realized (see Gtk.Widget.get_realized()).

Deprecated since version 0.52.

set_input_enabled(enabled)
Parameters:

enabled (bool) – whether to enable user input

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.

set_mouse_autohide(setting)
Parameters:

setting (bool) – whether the mouse pointer should autohide

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 Vte.Terminal.get_mouse_autohide().

set_pty(pty)
Parameters:

pty (Vte.Pty or None) – a Vte.Pty, or None

Sets pty as the PTY to use in self. Use None to unset the PTY.

set_rewrap_on_resize(rewrap)
Parameters:

rewrap (bool) – True if the terminal should rewrap on resize

Controls whether or not the terminal will rewrap its contents, including the scrollback history, whenever the terminal’s width changes.

Deprecated since version 0.58.

set_scroll_on_insert(scroll)
Parameters:

scroll (bool) – whether the terminal should scroll on insert

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.

New in version 0.76.

set_scroll_on_keystroke(scroll)
Parameters:

scroll (bool) – whether the terminal should scroll on keystrokes

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.

New in version 0.52.

set_scroll_on_output(scroll)
Parameters:

scroll (bool) – whether the terminal should scroll on output

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.

New in version 0.52.

set_scroll_unit_is_pixels(enable)
Parameters:

enable (bool) – whether to use pixels as scroll unit

Controls whether the terminal’s scroll unit is lines or pixels.

This function is rarely useful, except when the terminal is added to a Gtk.ScrolledWindow.

New in version 0.66.

set_scrollback_lines(lines)
Parameters:

lines (int) – the length of the history buffer

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”.

Note that this setting only affects the normal screen buffer. No scrollback is allowed on the alternate screen buffer.

set_size(columns, rows)
Parameters:
  • columns (int) – the desired number of columns

  • rows (int) – the desired number of rows

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.

Parameters:

text_blink_mode (Vte.TextBlinkMode) – the Vte.TextBlinkMode to use

Controls whether or not the terminal will allow blinking text.

New in version 0.52.

set_word_char_exceptions(exceptions)
Parameters:

exceptions (str) – a string of ASCII punctuation characters, or 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 None to reset the set of exception characters to the default.

New in version 0.40.

set_xalign(align)
Parameters:

align (Vte.Align) – alignment value from Vte.Align

Sets the horizontal alignment of self within its allocation.

Note: %VTE_ALIGN_START_FILL is not supported, and will be treated like Vte.Align.START.

New in version 0.76.

set_xfill(fill)
Parameters:

fill (bool) – fillment value from #VteFill

Sets the horizontal fillment of self within its allocation.

Note: %VTE_FILL_START_FILL is not supported, and will be treated like %VTE_FILL_START.

New in version 0.76.

set_yalign(align)
Parameters:

align (Vte.Align) – alignment value from Vte.Align

Sets the vertical alignment of self within its allocation.

New in version 0.76.

set_yfill(fill)
Parameters:

fill (bool) – fillment value from #VteFill

Sets the vertical fillment of self within its allocation. Note that yfill is only supported with yalign set to Vte.Align.START, and is ignored for all other yalign values.

New in version 0.76.

spawn_async(pty_flags, working_directory, argv, envv, spawn_flags, child_setup, timeout, cancellable, callback, *user_data)
Parameters:

A convenience function that wraps creating the Vte.Pty and spawning the child process on it. Like Vte.Terminal.spawn_with_fds_async(), except that this function does not allow passing file descriptors to the child process. See Vte.Terminal.spawn_with_fds_async() for more information.

New in version 0.48.

spawn_sync(pty_flags, working_directory, argv, envv, spawn_flags, child_setup, child_setup_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, or False on error with error filled in

child_pid:

a location to store the child PID, or None

Return type:

(bool, child_pid: int)

Starts the specified command under a newly-allocated controlling pseudo-terminal. The argv and envv lists should be 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 GLib.SpawnFlags.DO_NOT_REAP_CHILD will always be added to spawn_flags.

Note also that GLib.SpawnFlags.STDOUT_TO_DEV_NULL, GLib.SpawnFlags.STDERR_TO_DEV_NULL, and GLib.SpawnFlags.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(), GLib.spawn_async() and 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 Vte.Terminal.get_current_directory_uri(), GLib.get_current_dir() or get_current_dir_name().

Deprecated since version 0.48: Use Vte.Terminal.spawn_async() instead.

spawn_with_fds_async(pty_flags, working_directory, argv, envv, fds, map_fds, spawn_flags, child_setup, timeout, cancellable, callback, *user_data)
Parameters:

A convenience function that wraps creating the Vte.Pty and spawning the child process on it. See Vte.Pty.new_sync(), Vte.Pty.spawn_with_fds_async(), and Vte.Pty.spawn_finish() for more information.

When the operation is finished successfully, callback will be called with the child #GPid, and a None GLib.Error. The child PID will already be watched via Vte.Terminal.watch_child().

When the operation fails, callback will be called with a -1 #GPid, and a non-None GLib.Error containing the error information.

Note that GLib.SpawnFlags.STDOUT_TO_DEV_NULL, GLib.SpawnFlags.STDERR_TO_DEV_NULL, and GLib.SpawnFlags.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 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 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 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 self has been destroyed before the operation is called, callback will be called with a None self; 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 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 Vte.Terminal.get_current_directory_uri(), GLib.get_current_dir() or get_current_dir_name().

New in version 0.62.

unselect_all()

Clears the current selection.

watch_child(child_pid)
Parameters:

child_pid (int) – a #GPid

Watches child_pid. When the process exists, the Vte.Terminal ::child-exited signal will be called with the child’s exit status.

Prior to calling this function, a Vte.Pty must have been set in self using Vte.Terminal.set_pty(). When the child exits, the terminal’s Vte.Pty will be set to None.

Note: GLib.child_watch_add() or GLib.child_watch_add() must not have been called for child_pid, nor a GLib.Source for it been created with GLib.child_watch_source_new().

Note: when using the GLib.spawn_async() family of functions, the GLib.SpawnFlags.DO_NOT_REAP_CHILD flag MUST have been passed.

write_contents_sync(stream, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False if there was an error

Return type:

bool

Write contents of the current contents of self (including any scrollback history) to stream according to flags.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.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.

do_bell() virtual
do_char_size_changed(char_width, char_height) virtual
Parameters:
  • char_width (int) –

  • char_height (int) –

do_child_exited(status) virtual
Parameters:

status (int) –

do_commit(text, size) virtual
Parameters:
  • text (str) –

  • size (int) –

do_contents_changed() virtual
do_copy_clipboard() virtual

Places the selected text in the terminal in the #GDK_SELECTION_CLIPBOARD selection.

Deprecated since version 0.50: Use Vte.Terminal.copy_clipboard_format() with Vte.Format.TEXT instead.

do_cursor_moved() virtual
do_decrease_font_size() virtual
do_deiconify_window() virtual
do_encoding_changed() virtual
do_eof() virtual
do_icon_title_changed() virtual
do_iconify_window() virtual
do_increase_font_size() virtual
do_lower_window() virtual
do_maximize_window() virtual
do_move_window(x, y) virtual
Parameters:
do_paste_clipboard() virtual

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.

do_raise_window() virtual
do_refresh_window() virtual
do_resize_window(width, height) virtual
Parameters:
  • width (int) –

  • height (int) –

do_restore_window() virtual
do_selection_changed() virtual
do_setup_context_menu(context) virtual
Parameters:

context (Vte.EventContext) –

do_text_deleted() virtual
do_text_inserted() virtual
do_text_modified() virtual
do_text_scrolled(delta) virtual
Parameters:

delta (int) –

do_window_title_changed() virtual

Signal Details

Vte.Terminal.signals.bell(terminal)
Signal Name:

bell

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

This signal is emitted when the a child sends a bell request to the terminal.

Vte.Terminal.signals.char_size_changed(terminal, width, height)
Signal Name:

char-size-changed

Flags:

RUN_LAST

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • width (int) – the new character cell width

  • height (int) – the new character cell height

Emitted whenever the cell size changes, e.g. due to a change in font, font-scale or cell-width/height-scale.

Note that this signal should rather be called “cell-size-changed”.

Vte.Terminal.signals.child_exited(terminal, status)
Signal Name:

child-exited

Flags:

RUN_LAST

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • status (int) – the child’s exit status

This signal is emitted when the terminal detects that a child watched using Vte.Terminal.watch_child() has exited.

Vte.Terminal.signals.commit(terminal, text, size)
Signal Name:

commit

Flags:

RUN_LAST

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • text (str) – a string of text

  • size (int) – the length of that string of text

Emitted whenever the terminal receives input from the user and prepares to send it to the child process.

Vte.Terminal.signals.contents_changed(terminal)
Signal Name:

contents-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted whenever the visible appearance of the terminal has changed. Used primarily by #VteTerminalAccessible.

Vte.Terminal.signals.copy_clipboard(terminal)
Signal Name:

copy-clipboard

Flags:

RUN_LAST, ACTION

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted whenever Vte.Terminal.copy_clipboard() is called.

Vte.Terminal.signals.current_directory_uri_changed(terminal)
Signal Name:

current-directory-uri-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted when the current directory URI is modified.

Vte.Terminal.signals.current_file_uri_changed(terminal)
Signal Name:

current-file-uri-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted when the current file URI is modified.

Vte.Terminal.signals.cursor_moved(terminal)
Signal Name:

cursor-moved

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted whenever the cursor moves to a new character cell. Used primarily by #VteTerminalAccessible.

Vte.Terminal.signals.decrease_font_size(terminal)
Signal Name:

decrease-font-size

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted when the user hits the ‘-’ key while holding the Control key.

Vte.Terminal.signals.deiconify_window(terminal)
Signal Name:

deiconify-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.encoding_changed(terminal)
Signal Name:

encoding-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted whenever the terminal’s current encoding has changed.

Note: support for non-UTF-8 is deprecated.

Vte.Terminal.signals.eof(terminal)
Signal Name:

eof

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted when the terminal receives an end-of-file from a child which is running in the terminal. This signal is frequently (but not always) emitted with a Vte.Terminal ::child-exited signal.

Signal Name:

hyperlink-hover-uri-changed

Flags:

RUN_LAST

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • uri (str) – the nonempty target URI under the mouse, or None

  • bbox (Gdk.Rectangle) – the bounding box of the hyperlink anchor text, or None

Emitted when the hovered hyperlink changes.

uri and bbox are owned by VTE, must not be modified, and might change after the signal handlers returns.

The signal is not re-emitted when the bounding box changes for the same hyperlink. This might change in a future VTE version without notice.

New in version 0.50.

Vte.Terminal.signals.icon_title_changed(terminal)
Signal Name:

icon-title-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Deprecated since version 0.54: This signal is never emitted.

Vte.Terminal.signals.iconify_window(terminal)
Signal Name:

iconify-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.increase_font_size(terminal)
Signal Name:

increase-font-size

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted when the user hits the ‘+’ key while holding the Control key.

Vte.Terminal.signals.lower_window(terminal)
Signal Name:

lower-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.maximize_window(terminal)
Signal Name:

maximize-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.move_window(terminal, x, y)
Signal Name:

move-window

Flags:

RUN_LAST

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • x (int) – the terminal’s desired location, X coordinate

  • y (int) – the terminal’s desired location, Y coordinate

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.paste_clipboard(terminal)
Signal Name:

paste-clipboard

Flags:

RUN_LAST, ACTION

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted whenever Vte.Terminal.paste_clipboard() is called.

Vte.Terminal.signals.raise_window(terminal)
Signal Name:

raise-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.refresh_window(terminal)
Signal Name:

refresh-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.resize_window(terminal, width, height)
Signal Name:

resize-window

Flags:

RUN_LAST

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • width (int) – the desired number of columns

  • height (int) – the desired number of rows

Emitted at the child application’s request.

Vte.Terminal.signals.restore_window(terminal)
Signal Name:

restore-window

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Never emitted.

Deprecated since version 0.60.

Vte.Terminal.signals.selection_changed(terminal)
Signal Name:

selection-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted whenever the contents of terminal’s selection changes.

Vte.Terminal.signals.setup_context_menu()
Signal Name:

setup-context-menu

Flags:

RUN_LAST

Emitted with non-None context before terminal shows a context menu. The handler may set either a menu model using Vte.Terminal.set_context_menu_model(), or a menu using Vte.Terminal.set_context_menu(), which will then be used as context menu. If neither a menu model nor a menu are set, a context menu will not be shown.

Note that context is only valid during the signal emission; you may not retain it to call methods on it afterwards.

Also emitted with None context after the context menu has been dismissed.

Vte.Terminal.signals.text_deleted(terminal)
Signal Name:

text-deleted

Flags:

RUN_LAST, DEPRECATED

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Deprecated since version 0.66: This signal is never emitted.

Vte.Terminal.signals.text_inserted(terminal)
Signal Name:

text-inserted

Flags:

RUN_LAST, DEPRECATED

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Deprecated since version 0.66: This signal is never emitted.

Vte.Terminal.signals.text_modified(terminal)
Signal Name:

text-modified

Flags:

RUN_LAST, DEPRECATED

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Deprecated since version 0.66: This signal is never emitted.

Vte.Terminal.signals.text_scrolled(terminal, delta)
Signal Name:

text-scrolled

Flags:

RUN_LAST, DEPRECATED

Parameters:
  • terminal (Vte.Terminal) – The object which received the signal

  • delta (int) –

Deprecated since version 0.66: This signal is never emitted.

Vte.Terminal.signals.window_title_changed(terminal)
Signal Name:

window-title-changed

Flags:

RUN_LAST

Parameters:

terminal (Vte.Terminal) – The object which received the signal

Emitted when the Vte.Terminal :window-title property is modified.

Property Details

Vte.Terminal.props.allow_bold
Name:

allow-bold

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will attempt to draw bold text, by using a bold font variant.

Deprecated since version 0.60: There’s probably no reason for this feature to exist.

Name:

allow-hyperlink

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not hyperlinks (OSC 8 escape sequence) are recognized and displayed.

New in version 0.50.

Vte.Terminal.props.audible_bell
Name:

audible-bell

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will beep when the child outputs the “bl” sequence.

Vte.Terminal.props.backspace_binding
Name:

backspace-binding

Type:

Vte.EraseBinding

Default Value:

Vte.EraseBinding.AUTO

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls what string or control sequence the terminal sends to its child when the user presses the backspace key.

Vte.Terminal.props.bold_is_bright
Name:

bold-is-bright

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 0.52.

Vte.Terminal.props.cell_height_scale
Name:

cell-height-scale

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Scale factor for the cell height, to increase line spacing. (The font’s height is not affected.)

New in version 0.52.

Vte.Terminal.props.cell_width_scale
Name:

cell-width-scale

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Scale factor for the cell width, to increase letter spacing. (The font’s width is not affected.)

New in version 0.52.

Vte.Terminal.props.cjk_ambiguous_width
Name:

cjk-ambiguous-width

Type:

int

Default Value:

1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

This setting controls whether ambiguous-width characters are narrow or wide. (Note that when using a non-UTF-8 encoding set via Vte.Terminal.set_encoding(), the width of ambiguous-width characters is fixed and determined by the encoding itself.)

This setting only takes effect the next time the terminal is reset, either via escape sequence or with Vte.Terminal.reset().

Vte.Terminal.props.context_menu
Name:

context-menu

Type:

Gtk.Menu

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The menu used for context menus. Note that context menu model set with the Vte.Terminal ::context-menu-model property or Vte.Terminal.set_context_menu_model() takes precedence over this.

New in version 0.76.

Vte.Terminal.props.context_menu_model
Name:

context-menu-model

Type:

Gio.MenuModel

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The menu model used for context menus. If non-None, the context menu is generated from this model, and overrides a context menu set with the Vte.Terminal ::context-menu property or Vte.Terminal.set_context_menu().

New in version 0.76.

Vte.Terminal.props.current_directory_uri
Name:

current-directory-uri

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

The current directory URI, or None if unset.

Vte.Terminal.props.current_file_uri
Name:

current-file-uri

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

The current file URI, or None if unset.

Name:

cursor-blink-mode

Type:

Vte.CursorBlinkMode

Default Value:

Vte.CursorBlinkMode.SYSTEM

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Sets whether or not the cursor will blink. Using Vte.CursorBlinkMode.SYSTEM will use the Gtk.Settings :gtk-cursor-blink setting.

Vte.Terminal.props.cursor_shape
Name:

cursor-shape

Type:

Vte.CursorShape

Default Value:

Vte.CursorShape.BLOCK

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls the shape of the cursor.

Vte.Terminal.props.delete_binding
Name:

delete-binding

Type:

Vte.EraseBinding

Default Value:

Vte.EraseBinding.AUTO

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls what string or control sequence the terminal sends to its child when the user presses the delete key.

Vte.Terminal.props.enable_bidi
Name:

enable-bidi

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will perform bidirectional text rendering.

New in version 0.58.

Vte.Terminal.props.enable_fallback_scrolling
Name:

enable-fallback-scrolling

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Vte.Terminal.props.enable_shaping
Name:

enable-shaping

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will shape Arabic text.

New in version 0.58.

Vte.Terminal.props.enable_sixel
Name:

enable-sixel

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether SIXEL image support is enabled.

New in version 0.62.

Vte.Terminal.props.encoding
Name:

encoding

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls 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. The default is defined by the application’s locale settings.

Deprecated since version 0.54: Instead of using this, you should use a tool like luit(1) when support for non-UTF-8 is required

Vte.Terminal.props.font_desc
Name:

font-desc

Type:

Pango.FontDescription

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Specifies 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.

Vte.Terminal.props.font_options
Name:

font-options

Type:

cairo.FontOptions

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The terminal’s font options, or None to use the default font options.

Note that on GTK4, the terminal by default uses font options with cairo.HintMetrics.ON set; to override that, use this function to set a cairo.FontOptions that has cairo.HintMetrics.OFF set.

New in version 0.74.

Vte.Terminal.props.font_scale
Name:

font-scale

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The terminal’s font scale.

Name:

hyperlink-hover-uri

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

The currently hovered hyperlink URI, or None if unset.

New in version 0.50.

Vte.Terminal.props.icon_title
Name:

icon-title

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Deprecated since version 0.54: This property is always None.

Vte.Terminal.props.input_enabled
Name:

input-enabled

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether the terminal allows user input. When user input is disabled, key press and mouse button press and motion events are not sent to the terminal’s child.

Vte.Terminal.props.pointer_autohide
Name:

pointer-autohide

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls 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.

Vte.Terminal.props.pty
Name:

pty

Type:

Vte.Pty

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The PTY object for the terminal.

Vte.Terminal.props.rewrap_on_resize
Name:

rewrap-on-resize

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will rewrap its contents, including the scrollback buffer, whenever the terminal’s width changes.

Deprecated since version 0.58.

Vte.Terminal.props.scroll_on_insert
Name:

scroll-on-insert

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the text is inserted (e.g. by a paste).

New in version 0.76.

Vte.Terminal.props.scroll_on_keystroke
Name:

scroll-on-keystroke

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Vte.Terminal.props.scroll_on_output
Name:

scroll-on-output

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

Vte.Terminal.props.scroll_unit_is_pixels
Name:

scroll-unit-is-pixels

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether the terminal’s Gtk.Adjustment values unit is lines or pixels. This can be enabled when the terminal is the child of a Gtk.ScrolledWindow to fix some bugs with its kinetic scrolling.

New in version 0.66.

Vte.Terminal.props.scrollback_lines
Name:

scrollback-lines

Type:

int

Default Value:

512

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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. Note that this setting only affects the normal screen buffer. For terminal types which have an alternate screen buffer, no scrollback is allowed on the alternate screen buffer.

Name:

text-blink-mode

Type:

Vte.TextBlinkMode

Default Value:

Vte.TextBlinkMode.ALWAYS

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether or not the terminal will allow blinking text.

New in version 0.52.

Vte.Terminal.props.window_title
Name:

window-title

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

The terminal’s title.

Vte.Terminal.props.word_char_exceptions
Name:

word-char-exceptions

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

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 None, a built-in set is used.

New in version 0.40.

Vte.Terminal.props.xalign
Name:

xalign

Type:

Vte.Align

Default Value:

Vte.Align.START

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The horizontal alignment of terminal within its allocation.

New in version 0.76.

Vte.Terminal.props.xfill
Name:

xfill

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The horizontal fillment of terminal within its allocation.

New in version 0.76.

Vte.Terminal.props.yalign
Name:

yalign

Type:

Vte.Align

Default Value:

Vte.Align.START

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The vertical alignment of terminal within its allocation

New in version 0.76.

Vte.Terminal.props.yfill
Name:

yfill

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The vertical fillment of terminal within its allocation. Note that Vte.Terminal :yfill=:obj:True is only supported with Vte.Terminal :yalign=:obj:Vte.Align.START, and is ignored for all other yalign values.

New in version 0.76.