Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
No description available in the introspection data.
Synopsis
- newtype Pty = Pty (ManagedPtr Pty)
- class (GObject o, IsDescendantOf Pty o) => IsPty o
- toPty :: (MonadIO m, IsPty o) => o -> m Pty
- ptyChildSetup :: (HasCallStack, MonadIO m, IsPty a) => a -> m ()
- ptyClose :: (HasCallStack, MonadIO m, IsPty a) => a -> m ()
- ptyGetFd :: (HasCallStack, MonadIO m, IsPty a) => a -> m Int32
- ptyGetSize :: (HasCallStack, MonadIO m, IsPty a) => a -> m (Int32, Int32)
- ptyNewForeignSync :: (HasCallStack, MonadIO m, IsCancellable a) => Int32 -> Maybe a -> m Pty
- ptyNewSync :: (HasCallStack, MonadIO m, IsCancellable a) => [PtyFlags] -> Maybe a -> m Pty
- ptySetSize :: (HasCallStack, MonadIO m, IsPty a) => a -> Int32 -> Int32 -> m ()
- ptySetUtf8 :: (HasCallStack, MonadIO m, IsPty a) => a -> Bool -> m ()
- ptySpawnAsync :: (HasCallStack, MonadIO m, IsPty a, IsCancellable b) => a -> Maybe Text -> [[Char]] -> Maybe [[Char]] -> [SpawnFlags] -> Maybe SpawnChildSetupFunc -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- ptySpawnFinish :: (HasCallStack, MonadIO m, IsPty a, IsAsyncResult b) => a -> b -> m Int32
- ptySpawnWithFdsAsync :: (HasCallStack, MonadIO m, IsPty a, IsCancellable b) => a -> Maybe Text -> [[Char]] -> Maybe [[Char]] -> Maybe [Int32] -> Maybe [Int32] -> [SpawnFlags] -> Maybe SpawnChildSetupFunc -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- constructPtyFd :: (IsPty o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getPtyFd :: (MonadIO m, IsPty o) => o -> m Int32
- constructPtyFlags :: (IsPty o, MonadIO m) => [PtyFlags] -> m (GValueConstruct o)
- getPtyFlags :: (MonadIO m, IsPty o) => o -> m [PtyFlags]
Exported types
Memory-managed wrapper type.
Pty (ManagedPtr Pty) |
Instances
Eq Pty Source # | |
GObject Pty Source # | |
Defined in GI.Vte.Objects.Pty | |
ManagedPtrNewtype Pty Source # | |
Defined in GI.Vte.Objects.Pty toManagedPtr :: Pty -> ManagedPtr Pty # | |
TypedObject Pty Source # | |
Defined in GI.Vte.Objects.Pty | |
HasParentTypes Pty Source # | |
Defined in GI.Vte.Objects.Pty | |
IsGValue (Maybe Pty) Source # | Convert |
Defined in GI.Vte.Objects.Pty | |
type ParentTypes Pty Source # | |
Defined in GI.Vte.Objects.Pty type ParentTypes Pty = '[Object, Initable] |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, childSetup, close, forceFloating, freezeNotify, getv, init, isFloating, notify, notifyByPspec, ref, refSink, runDispose, spawnAsync, spawnFinish, spawnWithFdsAsync, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getFd, getProperty, getQdata, getSize.
Setters
childSetup
:: (HasCallStack, MonadIO m, IsPty a) | |
=> a |
|
-> m () |
No description available in the introspection data.
close
:: (HasCallStack, MonadIO m, IsPty a) | |
=> a |
|
-> m () |
Deprecated: (Since version 0.42)
Since 0.42 this is a no-op.
getFd
:: (HasCallStack, MonadIO m, IsPty a) | |
=> a |
|
-> m Int32 | Returns: the file descriptor of the PTY master in |
No description available in the introspection data.
getSize
Reads the pseudo terminal's window size.
If getting the window size failed, error
will be set to a IOError
.
newForeignSync
:: (HasCallStack, MonadIO m, IsCancellable a) | |
=> Int32 |
|
-> Maybe a |
|
-> m Pty | Returns: a new |
newSync
:: (HasCallStack, MonadIO m, IsCancellable a) | |
=> [PtyFlags] |
|
-> Maybe a |
|
-> m Pty | Returns: a new |
Allocates a new pseudo-terminal.
You can later use fork()
or the spawnAsync
family of functions
to start a process on the PTY.
If using fork()
, you MUST call ptyChildSetup
in the child.
If using spawnAsync
and friends, you MUST either use
ptyChildSetup
directly as the child setup function, or call
ptyChildSetup
from your own child setup function supplied.
When using terminalSpawnSync
with a custom child setup
function, ptyChildSetup
will be called before the supplied
function; you must not call it again.
Also, you MUST pass the SpawnFlagsDoNotReapChild
flag.
Note also that SpawnFlagsStdoutToDevNull
, SpawnFlagsStderrToDevNull
,
and SpawnFlagsChildInheritsStdin
are not supported, since stdin, stdout
and stderr of the child process will always be connected to the PTY.
Note that you should set the PTY's size using ptySetSize
before
spawning the child process, so that the child process has the correct
size from the start instead of starting with a default size and then
shortly afterwards receiving a <literal>SIGWINCH</literal> signal. You
should prefer using terminalPtyNewSync
which does this
automatically.
setSize
:: (HasCallStack, MonadIO m, IsPty a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m () | (Can throw |
Attempts to resize the pseudo terminal's window size. If successful, the OS kernel will send <literal>SIGWINCH</literal> to the child process group.
If setting the window size failed, error
will be set to a IOError
.
setUtf8
:: (HasCallStack, MonadIO m, IsPty a) | |
=> a |
|
-> Bool |
|
-> m () | (Can throw |
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.
spawnAsync
:: (HasCallStack, MonadIO m, IsPty a, IsCancellable b) | |
=> a |
|
-> Maybe Text |
|
-> [[Char]] |
|
-> Maybe [[Char]] |
|
-> [SpawnFlags] |
|
-> Maybe SpawnChildSetupFunc |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Like ptySpawnWithFdsAsync
, except that this function does not
allow passing file descriptors to the child process. See ptySpawnWithFdsAsync
for more information.
Since: 0.48
spawnFinish
:: (HasCallStack, MonadIO m, IsPty a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m Int32 | (Can throw |
No description available in the introspection data.
Since: 0.48
spawnWithFdsAsync
:: (HasCallStack, MonadIO m, IsPty a, IsCancellable b) | |
=> a |
|
-> Maybe Text |
|
-> [[Char]] |
|
-> Maybe [[Char]] |
|
-> Maybe [Int32] |
|
-> Maybe [Int32] |
|
-> [SpawnFlags] |
|
-> Maybe SpawnChildSetupFunc |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Starts the specified command under the pseudo-terminal pty
.
The argv
and envv
lists should be Nothing
-terminated.
The "TERM" environment variable is automatically set to a default value,
but can be overridden from envv
.
ptyFlags
controls logging the session to the specified system log files.
Note also that SpawnFlagsStdoutToDevNull
, SpawnFlagsStderrToDevNull
,
and SpawnFlagsChildInheritsStdin
are not supported in spawnFlags
, since
stdin, stdout and stderr of the child process will always be connected to
the PTY. Also SpawnFlagsLeaveDescriptorsOpen
is not supported; and
SpawnFlagsDoNotReapChild
will always be added to spawnFlags
.
If fds
is not Nothing
, the child process will map the file descriptors from
fds
according to mapFds
; nMapFds
must be less or equal to nFds
.
This function will take ownership of the file descriptors in fds
;
you must not use or close them after this call. All file descriptors in fds
must have the FD_CLOEXEC flag set on them; it will be unset in the child process
before calling man:execve(2). Note also that no file descriptor may be mapped
to stdin, stdout, or stderr (file descriptors 0, 1, or 2), since these will be
assigned to the PTY. All open file descriptors apart from those mapped as above
will be closed when execve()
is called.
Beginning with 0.60, and on linux only, and unless SPAWN_NO_SYSTEMD_SCOPE
is
passed in spawnFlags
, the newly created child process will be moved to its own
systemd user scope; and if 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.
See vte_pty_new()
, and terminalWatchChild
for more information.
Since: 0.62
Properties
fd
The file descriptor of the PTY master.
constructPtyFd :: (IsPty o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “fd
” property. This is rarely needed directly, but it is used by new
.
getPtyFd :: (MonadIO m, IsPty o) => o -> m Int32 Source #
Get the value of the “fd
” property.
When overloading is enabled, this is equivalent to
get
pty #fd
flags
Flags.
constructPtyFlags :: (IsPty o, MonadIO m) => [PtyFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “flags
” property. This is rarely needed directly, but it is used by new
.
getPtyFlags :: (MonadIO m, IsPty o) => o -> m [PtyFlags] Source #
Get the value of the “flags
” property.
When overloading is enabled, this is equivalent to
get
pty #flags