Oct-20-2019, 12:16 PM
with your code you can not execute a command
try
try
import gi gi.require_version('Gtk', '3.0') gi.require_version('Vte', '2.91') from gi.repository import Gtk, Vte, GLib, Pango, Gio import os class TheWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="GTK3 IDE") self.set_default_size(600, 300) terminal = Vte.Terminal() pty = Vte.Pty.new_sync(Vte.PtyFlags.DEFAULT) terminal.set_pty(pty) terminal.spawn_sync( Vte.PtyFlags.DEFAULT, os.environ['HOME'], ["/bin/sh"], [], GLib.SpawnFlags.DO_NOT_REAP_CHILD, None, None, ) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) scroller = Gtk.ScrolledWindow() scroller.set_hexpand(True) scroller.set_vexpand(True) scroller.add(terminal) box.pack_start(scroller, False, True, 2) self.add(box) def ready(self, pty, task): print('pty ', pty) win=TheWindow() win.connect('destroy', Gtk.main_quit) win.show_all() Gtk.main()