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 (31 lines) | stat: -rwxr-xr-x 748 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
29
30
31
#!/usr/bin/env ruby
=begin
  terminal.rb - Ruby/VTE4 sample script.

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

require "vte4"

application = Gtk::Application.new("io.github.ruby-gnome.example", :flags_none)

application.signal_connect "activate" do |app|
  window = Gtk::ApplicationWindow.new(app)
  window.title = "Terminal sample"

  terminal = Vte::Terminal.new
  terminal.enable_sixel = true
  terminal.signal_connect("child-exited") do |_widget|
    window.destroy
  end
  terminal.signal_connect("window-title-changed") do |_widget|
    window.title = terminal.window_title
  end
  terminal.spawn
  window.child = terminal

  window.present
end

application.run