Skip to content

Instantly share code, notes, and snippets.

@toshiharu
Created March 7, 2010 12:43
Show Gist options
  • Select an option

  • Save toshiharu/324350 to your computer and use it in GitHub Desktop.

Select an option

Save toshiharu/324350 to your computer and use it in GitHub Desktop.
#!/usr/bin/env seed
Gtk = imports.gi.Gtk;
Vte = imports.gi.Vte;
Gtk.init(Seed.argv);
var window = new Gtk.Window();
var vte = new Vte.Terminal();
vte.fork_command("/bin/bash");
window.add(vte);
window.show_all();
Gtk.main();
@Ethergeist
Copy link

Ethergeist commented Dec 3, 2016

#!/usr/bin/env gjs
/// <reference path="./typings/map.d.ts" /> (Got Typing files from https://github.com/niagr/gjs-ts)
const Gtk = imports.gi.Gtk;
const Vte = imports.gi.Vte;
const GLib = imports.gi.GLib;
const Gdk = imports.gi.Gdk;
Gtk.init(null);
var window = new Gtk.Window({title: 'Ether Terminal'});
var terminal = new Vte.Terminal();
const rGBA = new Gdk.RGBA({red:0, green: 0, blue: 0, alpha: 0.25})
terminal.set_can_focus(true);
terminal.set_allow_bold(true);
terminal.set_scroll_on_output(true);
terminal.set_scroll_on_keystroke(true);
terminal.set_scrollback_lines(8096);
terminal.set_color_background(rGBA);
terminal.spawn_sync(Vte.PtyFlags.DEFAULT, GLib.get_home_dir(), ['/usr/bin/bash'], null, GLib.SpawnFlags.SEARCH_PATH, null, null );
window.add(terminal);
window.show_all();
Gtk.main();

GJS version - The .fork_command() function has been replaced with .spawn_sync in the VTE libraries for anyone who is interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment