I'm trying to add vte
widget in my application and the examples I've found use .fork_command()
to execute a command in that widget.
But according to
http://developer.gnome.org/vte/0.26/VteTerminal.html#vte-terminal-fork-command
it was deprecated and it's recommended to use fork_command_full()
. Which needs eight mandatory arguments. Haven't they heard the "defaults" word? I've been able to construct lines that work somehow:
pty_flags = vte.PtyFlags(0)
terminal.fork_command_full(pty_flags, "/home/int", ("/bin/bash", ), "", 0, None, None)
Yes, I know about the enums, I just hope that I'm doing this completely wrong and there is a much easier way. Do you know any?
P.S. I'm using quickly
with the default ubuntu-application
template.
P.P.S. The import line is from gi.repository import Vte as vte
Here a basic example:
Building on ADcomp's answer to address wanting to add them dynamically in the future, I think you might want to subclass Vte.terminal.
Since VTE 0.38,
vte_terminal_fork_command_full ()
has been renamed tovte_terminal_spawn_sync ()
. So if you are using newer versions, you have to change @ADcomp's answer into the following:Vte.Terminal.spawn_sync is deprecated. So if you are using Vte version 0.48 or above, use Vte.Terminal.spawn_async instead. Here is an example of a Vte.Terminal.spawn_async: