VTE is a GTK library that provides a GTK Widget for terminal emulators.
-
Add the dependency to your
shard.yml
:dependencies: vte: github: hugopl/vte.cr
-
Run
shards install
require "vte"
class App < Gtk::Application
@[GObject::Virtual]
def activate
window = Gtk::ApplicationWindow.new(self)
window.title = "Basic Terminal"
window.set_default_size(1024, 480)
terminal = Vte::Terminal.new
terminal.feed("Crystal VTE bindings! 🎉️")
window.child = terminal
window.present
end
end
exit(BasicTerminalApp.new.run)
To spawn a process, e.g. bash
, use the Terminal#spawn_async
method, see examples/basic_terminal.cr.
- Fork it (https://github.com/hugopl/vte.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Hugo Parente Lima - creator and maintainer