Module: Vte

Extended by:
GLib::Deprecatable
Defined in:
lib/vte4/pty.rb,
lib/vte4.rb,
lib/vte4/regex.rb,
lib/vte4/loader.rb,
lib/vte4/version.rb,
lib/vte4/terminal.rb,
lib/vte4/deprecated.rb

Overview

Copyright (C) 2014-2023 Ruby-GNOME Project Team

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Defined Under Namespace

Modules: Align, CursorBlinkMode, CursorShape, EraseBinding, FeatureFlags, Format, ProgressHint, PropertyFlags, PropertyId, PropertyType, PtyError, PtyFlags, RegexError, TextBlinkMode, UuidFormat, Version, WriteFlags Classes: Error, Loader, Pty, Regex, Terminal

Constant Summary collapse

MAJOR_VERSION =

The major version number of the VTE library
(e.g. in version 3.1.4 this is 3).

0
MICRO_VERSION =

The micro version number of the VTE library
(e.g. in version 3.1.4 this is 4).

0
MINOR_VERSION =

The minor version number of the VTE library
(e.g. in version 3.1.4 this is 1).

84
REGEX_FLAGS_DEFAULT =
1075314688
SPAWN_NO_PARENT_ENVV =

Use this as a spawn flag (together with flags from GSpawn::Flags) in
vte_pty_spawn_async().

Normally, the spawned process inherits the environment from the parent
process; when this flag is used, only the environment variables passed
to vte_pty_spawn_async() etc. are passed to the child process.

33554432
SPAWN_NO_SYSTEMD_SCOPE =

Use this as a spawn flag (together with flags from GSpawn::Flags) in
vte_pty_spawn_async().

Prevents vte_pty_spawn_async() etc. from moving the newly created child
process to a systemd user scope.

67108864
SPAWN_REQUIRE_SYSTEMD_SCOPE =

Use this as a spawn flag (together with flags from GSpawn::Flags) in
vte_pty_spawn_async().

Requires vte_pty_spawn_async() etc. to move the newly created child
process to a systemd user scope; if that fails, the whole spawn fails.

This is supported on Linux only.

134217728
TERMPROP_CONTAINER_NAME =

A %VTE_PROPERTY_STRING termprop that stores the name of the
container.

vte.container.name
TERMPROP_CONTAINER_RUNTIME =

A %VTE_PROPERTY_STRING termprop that stores the runtime of the
container.

vte.container.runtime
TERMPROP_CONTAINER_UID =

A %VTE_PROPERTY_UINT termprop that stores the user ID of the
container.

vte.container.uid
TERMPROP_CURRENT_DIRECTORY_URI =

A %VTE_PROPERTY_URI termprop that stores the current directory
URI as set by OSC 7.
Use this with vte_terminal_ref_termprop_uri() instead of using
vte_terminal_get_current_directory_uri().

Note that this termprop is not settable via the termprop OSC.

vte.cwd
TERMPROP_CURRENT_FILE_URI =

A %VTE_PROPERTY_URI termprop that stores the current file URI
as set by OSC 6.
Use this with vte_terminal_ref_termprop_uri() instead of using
vte_terminal_get_current_file_uri().

Note that this termprop is not settable via the termprop OSC.

vte.cwf
TERMPROP_ICON_COLOR =
vte.icon.color
TERMPROP_ICON_IMAGE =

A %VTE_PROPERTY_IMAGE termprop to specify an image for use
as a favicon.

Applications should prefer to use this termprop, if set, over
the %VTE_TERMPROP_ICON_COLOR color.

Note that in this vte version, this termprop is always unset.

vte.icon.image
TERMPROP_NAME_PREFIX =

The string prefix that any termprop's name must start with to be installed
by vte_install_termprop().

vte.ext.
TERMPROP_PROGRESS_HINT =

A %VTE_PROPERTY_INT termprop that stores a hint how to interpret
the %VTE_TERMPROP_PROGRESS_VALUE termprop value. If set, this
termprop's value will be from the Vte::ProgressHint enumeration.
An unset termprop should be treated as if it had value
%VTE_PROGRESS_HINT_ACTIVE if the %VTE_TERMPROP_PROGRESS_VALUE
termprop has a value

Note that this termprop never will have the value
%VTE_PROGRESS_HINT_INACTIVE.

The value of this termprop should be ignored unless the
%VTE_TERMPROP_PROGRESS_VALUE termprop has a value.

Note that before version 0.82, this termprop could not be set by
the termprop OSC, but instead only by OSC 9 ; 4 (ConEmu progress).

vte.progress.hint
TERMPROP_PROGRESS_VALUE =

A %VTE_PROPERTY_UINT termprop that stores the progress of the running
command as a value between 0 and 100.

Note that before version 0.82, this termprop could not be set by
the termprop OSC, but instead only by OSC 9 ; 4 (ConEmu progress).

vte.progress.value
TERMPROP_SHELL_POSTEXEC =

An ephemeral %VTE_PROPERTY_UINT termprop that signals that the shell
has executed the commands entered at the prompt and these commands
have returned. The termprop value is the exit code.

vte.shell.postexec
TERMPROP_SHELL_PRECMD =

A %VTE_PROPERTY_VALUELESS termprop that signals that the shell
is going to prompt.

vte.shell.precmd
TERMPROP_SHELL_PREEXEC =

A %VTE_PROPERTY_VALUELESS termprop that signals that the shell
is preparing to execute the command entered at the prompt.

vte.shell.preexec
TERMPROP_XTERM_TITLE =

A %VTE_PROPERTY_STRING termprop that stores the xterm window title
as set by OSC 0 and OSC 2.
Use this with vte_terminal_get_termprop_string() instead of using
vte_terminal_get_window_title().

Note that this termprop is not settable via the termprop OSC.

xterm.title
TEST_FLAGS_ALL =
18446744073709551615
TEST_FLAGS_NONE =
0
LOG_DOMAIN =
"Vte"

Instance Method Summary collapse

Instance Method Details

#feature_flags ⇒ Vte::FeatureFlags

Gets features VTE was compiled with.

Returns:

#features ⇒ String

Gets a list of features vte was compiled with.

Returns:

  • (String) —

    a string with features

#get_encoding_supported(encoding) ⇒ Boolean

Queries whether the legacy encoding encoding is supported.

If ICU support is not available, this function always returns false.

Note that UTF-8 is always supported; you can select it by
passing nil to vte_terminal_set_encoding().

Parameters:

  • encoding (String) —

    the name of the legacy encoding

Returns:

  • (Boolean) —

    true iff the legacy encoding encoding is supported

#get_encodings(include_aliases) ⇒ Array<String>

Gets the list of supported legacy encodings.

If ICU support is not available, this returns an empty vector.
Note that UTF-8 is always supported; you can select it by
passing nil to vte_terminal_set_encoding().

Parameters:

  • include_aliases (Boolean) —

    whether to include alias names

Returns:

  • (Array<String>) —

    the list of supported encodings; free with
    g_strfreev()

#get_termprops(length) ⇒ Array<String>

Gets the names of the installed termprops in an unspecified order.

Parameters:

  • length (Integer) —

    a location to store the length of the returned array

Returns:

  • (Array<String>) —

    the names of the installed
    termprops, or nil if there are no termprops

#install_termprop(name, type, flags) ⇒ Integer

Installs a new terminal property that can be set by the application.

name must follow the rules for termprop names as laid out above; it
must have at least 4 components, the first two of which must be "vte",
and "ext". Use the %VTE_TERMPROP_NAME_PREFIX macro which defines this
name prefix.

You should use an identifier for your terminal as the first component
after the prefix, as a namespace marker.

It is a programming error to call this function with a name that does
not meet these requirements.

It is a programming error to call this function after any Vte::Terminal
instances have been created.

It is a programming error to call this function if the named termprop
is already installed with a different type or flags.

Parameters:

  • name (String) —

    a namespaced property name

  • type (Vte::PropertyType) —

    a Vte::PropertyType to use for the property

  • flags (Vte::PropertyFlags) —

    flags from Vte::PropertyFlags

Returns:

  • (Integer) —

    an ID for the termprop

#install_termprop_alias(name, target_name) ⇒ Integer

Installs a new terminal property name as an alias for the terminal
property target_name.

Parameters:

  • name (String) —

    a namespaced property name

  • target_name (String) —

    the target property name

Returns:

  • (Integer) —

    the ID for the termprop target_name

#major_version ⇒ Integer

Returns the major version of the VTE library at runtime.
Contrast this with %VTE_MAJOR_VERSION which represents
the version of the VTE library that the code was compiled
with.

Returns:

  • (Integer) —

    the major version

#micro_version ⇒ Integer

Returns the micro version of the VTE library at runtime.
Contrast this with %VTE_MICRO_VERSION which represents
the version of the VTE library that the code was compiled
with.

Returns:

  • (Integer) —

    the micro version

#minor_version ⇒ Integer

Returns the minor version of the VTE library at runtime.
Contrast this with %VTE_MINOR_VERSION which represents
the version of the VTE library that the code was compiled
with.

Returns:

  • (Integer) —

    the minor version

#pty_error_quark ⇒ GLib::Quark

Error domain for VTE PTY errors. Errors in this domain will be from the Vte::PtyError
enumeration. See #GError for more information on error domains.

Returns:

  • (GLib::Quark) —

    the error domain for VTE PTY errors

#query_termprop(name, resolved_name, prop, type, flags) ⇒ Boolean

Gets the property type of the termprop. For properties installed by
vte_install_termprop(), the name starts with "vte.ext.".

For an alias termprop (see vte_install_termprop_alias()), resolved_name
will be name of the alias' target termprop; otherwise it will be name.

Parameters:

  • name (String) —

    a termprop name

  • resolved_name (String) —

    a location to store the termprop's name

  • prop (Integer) —

    a location to store the termprop's ID

  • type (Vte::PropertyType) —

    a location to store the termprop's type as a Vte::PropertyType

  • flags (Vte::PropertyFlags) —

    a location to store the termprop's flags as a Vte::PropertyFlags

Returns:

  • (Boolean) —

    true iff the termprop exists, and then prop, type and
    flags will be filled in

#query_termprop_by_id(prop, name, type, flags) ⇒ Boolean

Like vte_query_termprop() except that it takes the termprop by ID.
See that function for more information.

For an alias termprop (see vte_install_termprop_alias()), resolved_name
will be name of the alias' target termprop; otherwise it will be name.

Parameters:

  • prop (Integer) —

    a termprop ID

  • name (String) —

    a location to store the termprop's name

  • type (Vte::PropertyType) —

    a location to store the termprop's type as a Vte::PropertyType

  • flags (Vte::PropertyFlags) —

    a location to store the termprop's flags as a Vte::PropertyFlags

Returns:

  • (Boolean) —

    true iff the termprop exists, and then name, type and
    flags will be filled in

#regex_error_quark ⇒ GLib::Quark

Returns:

  • (GLib::Quark)

#test_flags ⇒ Integer

Gets the test flags; see vte_set_test_flags() for more information.
Note that on non-debug builds, this always returns 0.

Returns:

  • (Integer) —

    the test flags

#test_flags=(flags) ⇒ nil

Sets test flags. This function is only useful for implementing
unit tests for vte itself; it is a no-op in non-debug builds.

Parameters:

  • flags (Integer) —

    flags

Returns:

  • (nil)

#user_shell ⇒ Vte::filename

Gets the user's shell, or nil. In the latter case, the
system default (usually "/bin/sh") should be used.

Returns:

  • (Vte::filename) —

    a newly allocated string with the
    user's shell, or nil

#uuid_validate_string(str, len, fmt) ⇒ Boolean

Checks whether str is a valid string representation of an UUID.

Parameters:

  • str (String) —

    a string

  • len (Vte::gssize) —

    the length of str, or -1 is str is NUL terminated

  • fmt (Vte::UuidFormat) —

    a Vte::UuidFormat

Returns:

  • (Boolean) —

    true iff str is a valid string representation