Pty

The terminal widget uses these functions to start commands with new controlling pseudo-terminals and to resize pseudo-terminals.

Constructors

this
this(VtePty* vtePty)

Sets our main struct and passes it to the parent class

this
this(VtePtyFlags flags)

Allocates a new pseudo-terminal. You can later use fork() or the g_spawn_async() family of functions to start a process on the PTY. If using fork(), you MUST call vte_pty_child_setup() in the child. If using g_spawn_async() and friends, you MUST either use vte_pty_child_setup() directly as the child setup function, or call vte_pty_child_setup() from your own child setup function supplied. When using vte_terminal_fork_command_full() with a custom child setup function, vte_pty_child_setup() will be called before the supplied function; you must not call it again. Also, you MUST pass the G_SPAWN_DO_NOT_REAP_CHILD flag. If GNOME PTY Helper is available and unless some of the VTE_PTY_NO_LASTLOG, VTE_PTY_NO_UTMP or VTE_PTY_NO_WTMP flags are passed in flags, the session is logged in the corresponding lastlog, utmp or wtmp system files. When passing VTE_PTY_NO_HELPER in flags, the GNOME PTY Helper is bypassed entirely. When passing VTE_PTY_NO_FALLBACK in flags, and opening a PTY using the PTY helper fails, there will be no fallback to allocate a PTY using Unix98 PTY functions.

this
this(int fd)

Creates a new VtePty for the PTY master fd. No entry will be made in the lastlog, utmp or wtmp system files. Note that the newly created VtePty will take ownership of fd and close it on finalize.

Members

Functions

childSetup
void childSetup()

FIXMEchpe

close
void close()

Cleans up the PTY, specifically any logging performed for the session. The file descriptor to the PTY master remains open.

getFd
int getFd()
getPtyStruct
VtePty* getPtyStruct()

Get the main Gtk struct

getSize
int getSize(int rows, int columns)

Reads the pseudo terminal's window size. If getting the window size failed, error will be set to a GIOError.

getStruct
void* getStruct()

the main Gtk struct as a void*

setSize
int setSize(int rows, int columns)

Attempts to resize the pseudo terminal's window size. If successful, the OS kernel will send SIGWINCH to the child process group. If setting the window size failed, error will be set to a GIOError.

setTerm
void setTerm(string emulation)

Sets what value of the TERM environment variable to set just after forking.

setUtf8
int setUtf8(int utf8)

Tells the kernel whether the terminal is UTF-8 or not, in case it can make use of the info. Linux 2.6.5 or so defines IUTF8 to make the line discipline do multibyte backspace correctly.

Mixins

__anonymous
mixin InitableT!(VtePty)
Undocumented in source.

Variables

vtePty
VtePty* vtePty;

the main Gtk struct

Inherited Members

From InitableIF

getInitableTStruct
GInitable* getInitableTStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

init
int init(Cancellable cancellable)

Initializes the object implementing the interface. The object must be initialized before any real use after initial construction, either with this function or g_async_initable_init_async(). Implementations may also support cancellation. If cancellable is not NULL, then initialization can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If cancellable is not NULL and the object doesn't support cancellable initialization the error G_IO_ERROR_NOT_SUPPORTED will be returned. If the object is not initialized, or initialization returns with an error, then all operations on the object except g_object_ref() and g_object_unref() are considered to be invalid, and have undefined behaviour. See the ??? section introduction for more details. Implementations of this method must be idempotent, i.e. multiple calls to this function with the same argument should return the same results. Only the first call initializes the object, further calls return the result of the first call. This is so that it's safe to implement the singleton pattern in the GObject constructor function. Since 2.22

newValist
ObjectG newValist(GType objectType, string firstPropertyName, void* varArgs, Cancellable cancellable)

Helper function for constructing GInitable object. This is similar to g_object_new_valist() but also initializes the object and returns NULL, setting an error on failure. Since 2.22

newv
void* newv(GType objectType, GParameter[] parameters, Cancellable cancellable)

Helper function for constructing GInitable object. This is similar to g_object_newv() but also initializes the object and returns NULL, setting an error on failure. Since 2.22

Meta