Skip to content

Instantly share code, notes, and snippets.

@keyiflerolsun
Forked from paledega/Simple-Terminal.py
Created February 18, 2021 02:34
Show Gist options
  • Save keyiflerolsun/0c81e3e92311ecea39faa164bc61211a to your computer and use it in GitHub Desktop.
Save keyiflerolsun/0c81e3e92311ecea39faa164bc61211a to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91')
from gi.repository import Gtk, Vte, GLib
terminal = Vte.Terminal()
terminal.connect("child_exited",Gtk.main_quit)
terminal.spawn_sync(Vte.PtyFlags.DEFAULT, None, ["/bin/bash"], [], GLib.SpawnFlags.DO_NOT_REAP_CHILD, None, None)
win = Gtk.Window()
win.connect('delete-event', Gtk.main_quit)
win.add(terminal)
win.show_all()
Gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment