mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-04 20:24:23 +02:00
Add rudimentary terminal to editor's bottom panel
In order to use the gdnative library as an editor plugin it was neccessary to set the `reloadable` property of the gdnlib file to false, in order to prevent crashes when the godot editor window lost focus. This may have consequences when recompiling the library. See: https://docs.godotengine.org/en/3.3/classes/class_gdnativelibrary.html#class-gdnativelibrary-property-reloadable Still crashes quite frequently and doesn't close child processes properly. Part of #43.
This commit is contained in:
parent
33e4640b4b
commit
5e25ebbab6
7 changed files with 320 additions and 1 deletions
|
@ -3,6 +3,7 @@ extends EditorPlugin
|
|||
|
||||
var pty_supported := OS.get_name() in ["X11", "Server", "OSX"]
|
||||
var asciicast_import_plugin
|
||||
var terminal_panel: Control
|
||||
|
||||
|
||||
func _enter_tree():
|
||||
|
@ -23,6 +24,9 @@ func _enter_tree():
|
|||
"X11", "Server", "OSX":
|
||||
pty_script = load("res://addons/godot_xterm/nodes/pty/unix/pty_unix.gd")
|
||||
add_custom_type("PTY", "Node", pty_script, pty_icon)
|
||||
terminal_panel = preload("./editor_plugins/terminal/terminal_panel.tscn").instance()
|
||||
terminal_panel.editor_interface = get_editor_interface()
|
||||
add_control_to_bottom_panel(terminal_panel, "Terminal")
|
||||
|
||||
|
||||
func _exit_tree():
|
||||
|
@ -34,3 +38,5 @@ func _exit_tree():
|
|||
|
||||
if pty_supported:
|
||||
remove_custom_type("PTY")
|
||||
remove_control_from_bottom_panel(terminal_panel)
|
||||
terminal_panel.free()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue