File: terminal.rb

package info (click to toggle)
ruby-gnome 4.3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,320 kB
  • sloc: ruby: 55,206; ansic: 29,012; xml: 333; sh: 229; cpp: 45; makefile: 42
file content (28 lines) | stat: -rwxr-xr-x 696 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby
=begin
  terminal.rb - Ruby/VTE3 sample script.

  Copyright (c) 2006-2020 Ruby-GNOME Project Team
  This program is licenced under the same licence as Ruby-GNOME.

  $Id: terminal.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $
=end

require "vte3"

window = Gtk::Window.new("Terminal sample")
window.signal_connect("destroy"){ Gtk.main_quit }

terminal = Vte::Terminal.new
terminal.enable_sixel = true if terminal.respond_to?(:enable_sixel=)
terminal.signal_connect("child-exited") do |_widget|
  Gtk.main_quit
end
terminal.signal_connect("window-title-changed") do |_widget|
  window.title = terminal.window_title
end
terminal.spawn
window.add(terminal)
window.show_all

Gtk.main