Vte.Terminal¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
|||
r/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
|||
r/en |
|
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
|||
r/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when the a child sends a bell request to the terminal. |
|
Emitted whenever the cell size changes, e.g. |
|
This signal is emitted when the terminal detects that a child watched using |
|
Emitted whenever the terminal receives input from the user and prepares to send it to the child process. |
|
Emitted whenever the visible appearance of the terminal has changed. |
|
Emitted whenever |
|
Emitted when the current directory URI is modified. |
|
Emitted when the current file URI is modified. |
|
Emitted whenever the cursor moves to a new character cell. |
|
Emitted when the user hits the ‘-’ key while holding the Control key. |
|
Never emitted. |
|
Emitted whenever the terminal’s current encoding has changed. |
|
Emitted when the terminal receives an end-of-file from a child which is running in the terminal. |
|
Emitted when the hovered hyperlink changes. |
|
|
|
Never emitted. |
|
Emitted when the user hits the ‘+’ key while holding the Control key. |
|
Never emitted. |
|
Never emitted. |
|
Never emitted. |
|
Emitted whenever |
|
Never emitted. |
|
Never emitted. |
|
Emitted at the child application’s request. |
|
Never emitted. |
|
Emitted whenever the contents of terminal’s selection changes. |
|
Emitted with non- |
|
|
|
|
|
|
|
|
|
Emitted when the |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
widget |
r |
Class Details¶
- class Vte.Terminal(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Vte.Terminal
object- Return type:
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
() withVte.Format.TEXT
instead.
- copy_clipboard_format(format)¶
- Parameters:
format (
Vte.Format
) – aVte.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 (seeGtk.TargetList.add_text_targets
() and gtk_selection_data_targets_includes_text()). ForVte.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:
regexes ([
GLib.Regex
]) – an array ofGLib.Regex
match_flags (
GLib.RegexMatchFlags
) – theGLib.RegexMatchFlags
to use when matching the regexes
- Returns:
-
- matches:
a location to store the matches
- Return type:
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:
Like
Vte.Terminal.event_check_regex_simple
(), but returns an array of strings, containing the matching text (orNone
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* useGLib.strfreev
() on it.New in version 0.62.
- feed(data)¶
-
Interprets data as if it were data received from a child process.
- feed_child(text)¶
-
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)¶
-
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()¶
-
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.
- get_allow_hyperlink()¶
-
Checks whether or not hyperlinks (OSC 8 escape sequence) are allowed.
New in version 0.50.
- get_audible_bell()¶
-
Checks whether or not the terminal will beep when the child outputs the “bl” sequence.
- get_bold_is_bright()¶
-
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:
New in version 0.52.
- get_cell_width_scale()¶
- Returns:
the terminal’s cell width scale
- Return type:
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:
- 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:
- get_cjk_ambiguous_width()¶
- Returns:
1 if ambiguous-width characters are narrow, or 2 if they are wide
- Return type:
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 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.
- Returns:
the context menu, or
None
- Return type:
Gtk.Widget
orNone
New in version 0.76.
- Returns:
the context menu model, or
None
- Return type:
New in version 0.76.
- get_current_directory_uri()¶
- get_current_file_uri()¶
- get_cursor_blink_mode()¶
- Returns:
cursor blink mode.
- Return type:
Returns the currently set cursor blink mode.
- get_cursor_position()¶
- Returns:
- Return type:
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:
Returns the currently set cursor shape.
- get_enable_bidi()¶
-
Checks whether the terminal performs bidirectional text rendering.
New in version 0.58.
- get_enable_fallback_scrolling()¶
-
New in version 0.64.
- get_enable_shaping()¶
-
Checks whether the terminal shapes Arabic text.
New in version 0.58.
- get_encoding()¶
-
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:
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_geometry_hints(min_rows, min_columns)¶
- Parameters:
- 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
andGdk.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()¶
-
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_mouse_autohide()¶
-
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_rewrap_on_resize()¶
-
Checks whether or not the terminal will rewrap its contents upon resize.
Deprecated since version 0.58.
- 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:
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:
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:
New in version 0.52.
- get_scroll_unit_is_pixels()¶
-
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:
New in version 0.52.
- get_text(is_selected, *user_data)¶
- Parameters:
is_selected (
Vte.SelectionFunc
orNone
) – aVte.SelectionFunc
callback. Deprecated: 0.44: Always passNone
here.user_data (
object
orNone
) – 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
orNone
, 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 returnNone
. Since 0.72, passing a non-None
is_selected parameter will make this function itself returnNone
.Deprecated since version 0.76: Use
Vte.Terminal.get_text_format
() instead
- get_text_blink_mode()¶
- Returns:
the blinking setting
- Return type:
Checks whether or not the terminal will allow blinking text.
New in version 0.52.
- get_text_format(format)¶
- Parameters:
format (
Vte.Format
) – theVte.Format
to use- Returns:
a newly allocated text string, or
None
.- Return type:
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:
is_selected (
Vte.SelectionFunc
orNone
) – aVte.SelectionFunc
callback. Deprecated: 0.44: Always passNone
here.user_data (
object
orNone
) – 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
, 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 returnNone
. Since 0.72, passing a non-None
is_selected parameter will make this function itself returnNone
.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 datastart_col (
int
) – first column to search for dataend_row (
int
) – last row to search for dataend_col (
int
) – last column to search for datais_selected (
Vte.SelectionFunc
orNone
) – aVte.SelectionFunc
callback. Deprecated: 0.44: Always passNone
hereuser_data (
object
orNone
) – 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
orNone
, 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 returnNone
. Since 0.72, passing a non-None
is_selected function will make this function itself returnNone
.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
) – theVte.Format
to usestart_row (
int
) – the first row of the rangestart_col (
int
) – the first column of the rangeend_row (
int
) – the last row of the rangeend_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:
Returns the specified range of text in the specified format.
New in version 0.72.
- get_text_selected(format)¶
- Parameters:
format (
Vte.Format
) – theVte.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:
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
) – theVte.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:
Gets the currently selected text in the format specified by format.
New in version 0.72.
- get_word_char_exceptions()¶
-
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:
New in version 0.76.
- get_xfill()¶
- Returns:
the horizontal fillment of self within its allocation
- Return type:
New in version 0.76.
- get_yalign()¶
- Returns:
the vertical alignment of self within its allocation
- Return type:
New in version 0.76.
- get_yfill()¶
- Returns:
the vertical fillment of self within its allocation
- Return type:
New in version 0.76.
- hyperlink_check_event(event)¶
- Parameters:
- Returns:
a newly allocated string containing the target of the hyperlink, or
None
- Return type:
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:
gregex (
GLib.Regex
) – aGLib.Regex
gflags (
GLib.RegexMatchFlags
) – theGLib.RegexMatchFlags
to use when matching the regex
- Returns:
-1
- Return type:
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:
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:
- 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:
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:
- 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:
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 cursorcursor (
Gdk.Cursor
orNone
) – theGdk.Cursor
which the terminal should use when the pattern is highlighted, orNone
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:
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:
tag (
int
) – the tag of the regex which should use the specified cursorcursor_type (
Gdk.CursorType
) – aGdk.CursorType
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:
flags (
Vte.PtyFlags
) – flags fromVte.PtyFlags
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
a new
Vte.Pty
- Return type:
Creates a new
Vte.Pty
, sets the emulation property fromVte.Terminal
:emulation
, and sets the size using self's size.See vte_pty_new() for more information.
- reset(clear_tabstops, clear_history)¶
- Parameters:
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()¶
-
Searches the next string matching the search regex set with
Vte.Terminal.search_set_regex
().
- search_find_previous()¶
-
Searches the previous string matching the search regex set with
Vte.Terminal.search_set_regex
().
- search_get_gregex()¶
- Returns:
- Return type:
Deprecated since version 0.46: use
Vte.Terminal.search_get_regex
() instead.
- search_get_regex()¶
-
New in version 0.46.
- search_set_gregex(gregex, gflags)¶
- Parameters:
gregex (
GLib.Regex
orNone
) – aGLib.Regex
, orNone
gflags (
GLib.RegexMatchFlags
) – flags fromGLib.RegexMatchFlags
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)¶
-
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)¶
-
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.
- set_allow_hyperlink(allow_hyperlink)¶
-
Controls whether or not hyperlinks (OSC 8 escape sequence) are allowed.
New in version 0.50.
- set_audible_bell(is_audible)¶
-
Controls whether or not the terminal will beep when the child outputs the “bl” sequence.
- set_backspace_binding(binding)¶
- Parameters:
binding (
Vte.EraseBinding
) – aVte.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)¶
-
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)¶
-
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
orNone
) – the new color to use for the text cursor, orNone
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
orNone
) – the new color to use for the text cursor, orNone
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
orNone
) – the new color to use for highlighted text, orNone
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
orNone
) – the new color to use for highlighted text, orNone
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 isNone
and palette_size is greater than 0, the new background color is taken from palette[0].
- Parameters:
menu (
Gtk.Widget
orNone
) – 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.
- Parameters:
model (
Gio.MenuModel
orNone
) – aGio.MenuModel
Sets model as the context menu model in self. Use
None
to unset the current menu model.New in version 0.76.
- set_cursor_blink_mode(mode)¶
- Parameters:
mode (
Vte.CursorBlinkMode
) – theVte.CursorBlinkMode
to use
Sets whether or not the cursor will blink. Using
Vte.CursorBlinkMode.SYSTEM
will use theGtk.Settings
::gtk-cursor-blink
setting.
- set_cursor_shape(shape)¶
- Parameters:
shape (
Vte.CursorShape
) – theVte.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
) – aVte.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)¶
-
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)¶
-
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
orNone
) – target charset, orNone
to use UTF-8- Raises:
- Returns:
True
if the encoding could be changed to the specified one, orFalse
with error set toGLib.ConvertError.NO_CONVERSION
.- Return type:
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
orNone
) – aPango.FontDescription
for the desired font, orNone
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
orNone
) – the font options, orNone
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 acairo.FontOptions
that hascairo.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
) – aGtk.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_rewrap_on_resize(rewrap)¶
-
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”.
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.
- set_size(columns, 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.
- set_text_blink_mode(text_blink_mode)¶
- Parameters:
text_blink_mode (
Vte.TextBlinkMode
) – theVte.TextBlinkMode
to use
Controls whether or not the terminal will allow blinking text.
New in version 0.52.
- set_word_char_exceptions(exceptions)¶
-
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)¶
-
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)¶
-
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:
pty_flags (
Vte.PtyFlags
) – flags fromVte.PtyFlags
working_directory (
str
orNone
) – the name of a directory the command should start in, orNone
to use the current working directoryargv ([
str
]) – child’s argument vectorenvv ([
str
] orNone
) – a list of environment variables to be added to the environment before starting the process, orNone
spawn_flags (
GLib.SpawnFlags
) – flags fromGLib.SpawnFlags
child_setup (
GLib.SpawnChildSetupFunc
orNone
) – an extra child setup function to run in the child just before exec(), orNone
timeout (
int
) – a timeout value in ms, -1 for the default timeout, orGObject.G_MAXINT
to wait indefinitelycancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Vte.TerminalSpawnAsyncCallback
orNone
) – aVte.TerminalSpawnAsyncCallback
, orNone
user_data (
object
orNone
) – user data for callback, orNone
A convenience function that wraps creating the
Vte.Pty
and spawning the child process on it. LikeVte.Terminal.spawn_with_fds_async
(), except that this function does not allow passing file descriptors to the child process. SeeVte.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:
pty_flags (
Vte.PtyFlags
) – flags fromVte.PtyFlags
working_directory (
str
orNone
) – the name of a directory the command should start in, orNone
to use the current working directoryargv ([
str
]) – child’s argument vectorenvv ([
str
] orNone
) – a list of environment variables to be added to the environment before starting the process, orNone
spawn_flags (
GLib.SpawnFlags
) – flags fromGLib.SpawnFlags
child_setup (
GLib.SpawnChildSetupFunc
orNone
) – an extra child setup function to run in the child just before exec(), orNone
child_setup_data (
object
orNone
) – user data for child_setupcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
on success, orFalse
on error with error filled in- child_pid:
a location to store the child PID, or
None
- Return type:
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
, andGLib.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
() andVte.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:
pty_flags (
Vte.PtyFlags
) – flags fromVte.PtyFlags
working_directory (
str
orNone
) – the name of a directory the command should start in, orNone
to use the current working directoryargv ([
str
]) – child’s argument vectorenvv ([
str
] orNone
) – a list of environment variables to be added to the environment before starting the process, orNone
spawn_flags (
GLib.SpawnFlags
) – flags fromGLib.SpawnFlags
child_setup (
GLib.SpawnChildSetupFunc
orNone
) – an extra child setup function to run in the child just before exec(), orNone
timeout (
int
) – a timeout value in ms, -1 for the default timeout, orGObject.G_MAXINT
to wait indefinitelycancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Vte.TerminalSpawnAsyncCallback
orNone
) – aVte.TerminalSpawnAsyncCallback
, orNone
user_data (
object
orNone
) – user data for callback, orNone
A convenience function that wraps creating the
Vte.Pty
and spawning the child process on it. SeeVte.Pty.new_sync
(),Vte.Pty.spawn_with_fds_async
(), andVte.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 viaVte.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
, andGLib.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 ifVte.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-destroyedVte.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 usingVte.Terminal.set_pty
(). When the child exits, the terminal’sVte.Pty
will be set toNone
.Note:
GLib.child_watch_add
() orGLib.child_watch_add
() must not have been called for child_pid, nor aGLib.Source
for it been created withGLib.child_watch_source_new
().Note: when using the
GLib.spawn_async
() family of functions, theGLib.SpawnFlags.DO_NOT_REAP_CHILD
flag MUST have been passed.
- write_contents_sync(stream, flags, cancellable)¶
- Parameters:
stream (
Gio.OutputStream
) – aGio.OutputStream
to write toflags (
Vte.WriteFlags
) – a set ofVte.WriteFlags
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
object, orNone
- Raises:
- Returns:
- Return type:
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 errorGio.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¶
- 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
() withVte.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_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_restore_window() virtual¶
- do_selection_changed() virtual¶
- Parameters:
context (
Vte.EventContext
) –
- do_text_deleted() virtual¶
- do_text_inserted() virtual¶
- do_text_modified() virtual¶
- do_window_title_changed() virtual¶
Signal Details¶
- Vte.Terminal.signals.bell(terminal)¶
- Signal Name:
bell
- Flags:
- 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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signalwidth (
int
) – the new character cell widthheight (
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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signalstatus (
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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signaltext (
str
) – a string of textsize (
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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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.
- Vte.Terminal.signals.hyperlink_hover_uri_changed(terminal, uri, bbox)¶
- Signal Name:
hyperlink-hover-uri-changed
- Flags:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signaluri (
str
) – the nonempty target URI under the mouse, orNone
bbox (
Gdk.Rectangle
) – the bounding box of the hyperlink anchor text, orNone
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:
- 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:
- 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:
- 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:
- 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:
- 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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signalx (
int
) – the terminal’s desired location, X coordinatey (
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:
- 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:
- 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:
- 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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signalwidth (
int
) – the desired number of columnsheight (
int
) – the desired number of rows
Emitted at the child application’s request.
- Vte.Terminal.signals.restore_window(terminal)¶
- Signal Name:
restore-window
- Flags:
- 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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signal
Emitted whenever the contents of terminal’s selection changes.
- Signal Name:
setup-context-menu
- Flags:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signalcontext (
Vte.EventContext
orNone
) – the context
Emitted with non-
None
context before terminal shows a context menu. The handler may set either a menu model usingVte.Terminal.set_context_menu_model
(), or a menu usingVte.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:
- 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:
- 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:
- 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:
- Parameters:
terminal (
Vte.Terminal
) – The object which received the signaldelta (
int
) –
Deprecated since version 0.66: This signal is never emitted.
- Vte.Terminal.signals.window_title_changed(terminal)¶
- Signal Name:
window-title-changed
- Flags:
- 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:
- Default Value:
- Flags:
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.
- Vte.Terminal.props.allow_hyperlink¶
- Name:
allow-hyperlink
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
Controls whether or not the terminal will beep when the child outputs the “bl” sequence.
- Vte.Terminal.props.backspace_binding¶
- Name:
backspace-binding
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
1.0
- Flags:
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:
- Default Value:
1.0
- Flags:
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:
- Default Value:
1
- Flags:
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
().
- Name:
context-menu
- Type:
- Default Value:
- Flags:
The menu used for context menus. Note that context menu model set with the
Vte.Terminal
::context-menu-model
property orVte.Terminal.set_context_menu_model
() takes precedence over this.New in version 0.76.
- Name:
context-menu-model
- Type:
- Default Value:
- Flags:
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 theVte.Terminal
::context-menu
property orVte.Terminal.set_context_menu
().New in version 0.76.
- Vte.Terminal.props.current_directory_uri¶
- Name:
current-directory-uri
- Type:
- Default Value:
- Flags:
The current directory URI, or
None
if unset.
- Vte.Terminal.props.current_file_uri¶
- Name:
current-file-uri
- Type:
- Default Value:
- Flags:
The current file URI, or
None
if unset.
- Vte.Terminal.props.cursor_blink_mode¶
- Name:
cursor-blink-mode
- Type:
- Default Value:
- Flags:
Sets whether or not the cursor will blink. Using
Vte.CursorBlinkMode.SYSTEM
will use theGtk.Settings
:gtk-cursor-blink
setting.
- Vte.Terminal.props.cursor_shape¶
- Name:
cursor-shape
- Type:
- Default Value:
- Flags:
Controls the shape of the cursor.
- Vte.Terminal.props.delete_binding¶
- Name:
delete-binding
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
- Vte.Terminal.props.enable_shaping¶
- Name:
enable-shaping
- Type:
- Default Value:
- Flags:
Controls whether or not the terminal will shape Arabic text.
New in version 0.58.
- Vte.Terminal.props.enable_sixel¶
- Name:
enable-sixel
- Type:
- Default Value:
- Flags:
Controls whether SIXEL image support is enabled.
New in version 0.62.
- Vte.Terminal.props.encoding¶
- Name:
encoding
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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 acairo.FontOptions
that hascairo.HintMetrics.OFF
set.New in version 0.74.
- Vte.Terminal.props.font_scale¶
- Name:
font-scale
- Type:
- Default Value:
1.0
- Flags:
The terminal’s font scale.
- Vte.Terminal.props.hyperlink_hover_uri¶
- Name:
hyperlink-hover-uri
- Type:
- Default Value:
- Flags:
The currently hovered hyperlink URI, or
None
if unset.New in version 0.50.
- Vte.Terminal.props.icon_title¶
- Name:
icon-title
- Type:
- Default Value:
- Flags:
Deprecated since version 0.54: This property is always
None
.
- Vte.Terminal.props.input_enabled¶
- Name:
input-enabled
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
The PTY object for the terminal.
- Vte.Terminal.props.rewrap_on_resize¶
- Name:
rewrap-on-resize
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
Controls whether the terminal’s
Gtk.Adjustment
values unit is lines or pixels. This can be enabled when the terminal is the child of aGtk.ScrolledWindow
to fix some bugs with its kinetic scrolling.New in version 0.66.
- Vte.Terminal.props.scrollback_lines¶
- Name:
scrollback-lines
- Type:
- Default Value:
512
- Flags:
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.
- Vte.Terminal.props.text_blink_mode¶
- Name:
text-blink-mode
- Type:
- Default Value:
- Flags:
Controls whether or not the terminal will allow blinking text.
New in version 0.52.
- Vte.Terminal.props.window_title¶
- Name:
window-title
- Type:
- Default Value:
- Flags:
The terminal’s title.
- Vte.Terminal.props.word_char_exceptions¶
- Name:
word-char-exceptions
- Type:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
The horizontal alignment of terminal within its allocation.
New in version 0.76.
- Vte.Terminal.props.xfill¶
- Name:
xfill
- Type:
- Default Value:
- Flags:
The horizontal fillment of terminal within its allocation.
New in version 0.76.
- Vte.Terminal.props.yalign¶
- Name:
yalign
- Type:
- Default Value:
- Flags:
The vertical alignment of terminal within its allocation
New in version 0.76.
- Vte.Terminal.props.yfill¶
- Name:
yfill
- Type:
- Default Value:
- Flags:
The vertical fillment of terminal within its allocation. Note that
Vte.Terminal
:yfill
=:obj:True is only supported withVte.Terminal
:yalign
=:obj:Vte.Align.START, and is ignored for all other yalign values.New in version 0.76.