Move terminal.gd and pty.gd to godot_xterm directory

Makes for pretty paths when extending scripts:
`extends "res://addons/godot_xterm/terminal.gd"`
vs.
`extends "res://addons/godot_xterm/nodes/terminal/terminal.gd"`

Currently "res://addons/godot_xterm/pty.gd" is acutally `pty_unix.gd`.
This is okay for now as the PTY node is only supported on Unix
platforms. However, we will need to sort it out when adding Windows
support as part of #25.

Also remove the GDXterm namespace.
This commit is contained in:
Leroy Hopson 2021-07-26 00:31:23 +07:00
parent e6db81615e
commit 9d15420df3
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
22 changed files with 46 additions and 43 deletions

View file

@ -1,5 +1,5 @@
tool tool
extends "../../nodes/terminal/terminal.gd" extends "../../terminal.gd"
signal exited(exit_code, signum) signal exited(exit_code, signum)

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/godot_xterm/editor_plugins/terminal/editor_terminal.gd" type="Script" id=1] [ext_resource path="res://addons/godot_xterm/editor_plugins/terminal/editor_terminal.gd" type="Script" id=1]
[ext_resource path="res://addons/godot_xterm/nodes/pty/unix/pty_unix.gd" type="Script" id=2] [ext_resource path="res://addons/godot_xterm/pty.gd" type="Script" id=2]
[ext_resource path="res://addons/godot_xterm/themes/default.tres" type="Theme" id=3] [ext_resource path="res://addons/godot_xterm/themes/default.tres" type="Theme" id=3]
[node name="Terminal" type="Control"] [node name="Terminal" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0

View file

@ -8,7 +8,7 @@ tool
extends Control extends Control
const EditorTerminal := preload("./editor_terminal.tscn") const EditorTerminal := preload("./editor_terminal.tscn")
const PTY := preload("../../nodes/pty/pty.gd") const PTY := preload("../../pty.gd")
const TerminalSettings := preload("./settings/terminal_settings.gd") const TerminalSettings := preload("./settings/terminal_settings.gd")
const SETTINGS_FILE_PATH := "res://.gdxterm/settings.tres" const SETTINGS_FILE_PATH := "res://.gdxterm/settings.tres"

View file

@ -2,7 +2,7 @@
[ext_resource path="res://addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd" type="Script" id=1] [ext_resource path="res://addons/godot_xterm/editor_plugins/terminal/terminal_panel.gd" type="Script" id=1]
[sub_resource type="Image" id=6] [sub_resource type="Image" id=1]
data = { data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "LumAlpha8", "format": "LumAlpha8",
@ -14,7 +14,7 @@ data = {
[sub_resource type="ImageTexture" id=2] [sub_resource type="ImageTexture" id=2]
flags = 4 flags = 4
flags = 4 flags = 4
image = SubResource( 6 ) image = SubResource( 1 )
size = Vector2( 16, 16 ) size = Vector2( 16, 16 )
[sub_resource type="StyleBoxTexture" id=3] [sub_resource type="StyleBoxTexture" id=3]
@ -25,7 +25,7 @@ margin_right = 2.0
margin_top = 2.0 margin_top = 2.0
margin_bottom = 2.0 margin_bottom = 2.0
[sub_resource type="Image" id=7] [sub_resource type="Image" id=4]
data = { data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8", "format": "RGBA8",
@ -37,7 +37,7 @@ data = {
[sub_resource type="ImageTexture" id=5] [sub_resource type="ImageTexture" id=5]
flags = 0 flags = 0
flags = 0 flags = 0
image = SubResource( 7 ) image = SubResource( 4 )
size = Vector2( 16, 16 ) size = Vector2( 16, 16 )
[node name="Panel" type="Panel"] [node name="Panel" type="Panel"]
@ -144,7 +144,6 @@ __meta__ = {
} }
[node name="SizeLabelTimer" type="Timer" parent="SizeLabel"] [node name="SizeLabelTimer" type="Timer" parent="SizeLabel"]
[connection signal="resized" from="." to="." method="_on_Panel_resized"] [connection signal="resized" from="." to="." method="_on_Panel_resized"]
[connection signal="reposition_active_tab_request" from="VBoxContainer/TabbarContainer/Tabs" to="." method="_on_Tabs_reposition_active_tab_request"] [connection signal="reposition_active_tab_request" from="VBoxContainer/TabbarContainer/Tabs" to="." method="_on_Tabs_reposition_active_tab_request"]
[connection signal="tab_changed" from="VBoxContainer/TabbarContainer/Tabs" to="." method="_on_Tabs_tab_changed"] [connection signal="tab_changed" from="VBoxContainer/TabbarContainer/Tabs" to="." method="_on_Tabs_tab_changed"]

View file

@ -1,5 +0,0 @@
class_name GDXterm
const Terminal := preload("./nodes/terminal/terminal.gd")
const PTYUnix := preload("./nodes/pty/unix/pty_unix.gd")
const TPut := preload("./util/tput.gd")

View file

@ -9,7 +9,7 @@ extends Node
const LibuvUtils := preload("./libuv_utils.gd") const LibuvUtils := preload("./libuv_utils.gd")
const Pipe := preload("./pipe.gdns") const Pipe := preload("./pipe.gdns")
const Terminal := preload("../terminal/terminal.gd") const Terminal := preload("../../terminal.gd")
const DEFAULT_NAME := "xterm-256color" const DEFAULT_NAME := "xterm-256color"
const DEFAULT_COLS := 80 const DEFAULT_COLS := 80

View file

@ -17,7 +17,7 @@ func _enter_tree():
var asciicast_script = preload("./resources/asciicast.gd") var asciicast_script = preload("./resources/asciicast.gd")
add_custom_type("Asciicast", "Animation", asciicast_script, null) add_custom_type("Asciicast", "Animation", asciicast_script, null)
var terminal_script = preload("./nodes/terminal/terminal.gd") var terminal_script = preload("./terminal.gd")
var terminal_icon = preload("./nodes/terminal/terminal_icon.svg") var terminal_icon = preload("./nodes/terminal/terminal_icon.svg")
add_custom_type("Terminal", "Control", terminal_script, terminal_icon) add_custom_type("Terminal", "Control", terminal_script, terminal_icon)
@ -27,7 +27,7 @@ func _enter_tree():
var pty_script var pty_script
match OS.get_name(): match OS.get_name():
"X11", "Server", "OSX": "X11", "Server", "OSX":
pty_script = load("%s/nodes/pty/unix/pty_unix.gd" % base_dir) pty_script = load("%s/nodes/pty/pty.gd" % base_dir)
add_custom_type("PTY", "Node", pty_script, pty_icon) add_custom_type("PTY", "Node", pty_script, pty_icon)
var terminal_settings_script = preload("./editor_plugins/terminal/settings/terminal_settings.gd") var terminal_settings_script = preload("./editor_plugins/terminal/settings/terminal_settings.gd")
add_custom_type("TerminalSettings", "Resource", terminal_settings_script, null) add_custom_type("TerminalSettings", "Resource", terminal_settings_script, null)

View file

@ -5,9 +5,9 @@
# Copyright (c) 2021, Leroy Hopson (MIT License). # Copyright (c) 2021, Leroy Hopson (MIT License).
tool tool
extends "../pty.gd" extends "./nodes/pty/pty.gd"
const PTYUnix = preload("./pty_unix.gdns") const PTYUnix = preload("./nodes/pty/unix/pty_unix.gdns")
const FALLBACK_FILE = "sh" const FALLBACK_FILE = "sh"
@ -36,7 +36,7 @@ func _resize(cols: int, rows: int) -> void:
func _fork_thread(args): func _fork_thread(args):
var result = preload("./pty_unix.gdns").new().callv("fork", args) var result = preload("./nodes/pty/unix/pty_unix.gdns").new().callv("fork", args)
return result return result

View file

@ -44,8 +44,8 @@ export var bell_cooldown: float = 0.1
export var blink_on_time: float = 0.6 export var blink_on_time: float = 0.6
export var blink_off_time: float = 0.3 export var blink_off_time: float = 0.3
var _default_theme: Theme = preload("../../themes/default.tres") var _default_theme: Theme = preload("./themes/default.tres")
var _viewport: Viewport = preload("./viewport.tscn").instance() var _viewport: Viewport = preload("./nodes/terminal/viewport.tscn").instance()
var _native_terminal: Control = _viewport.get_node("Terminal") var _native_terminal: Control = _viewport.get_node("Terminal")
var _screen := TextureRect.new() var _screen := TextureRect.new()

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/godot_xterm/nodes/terminal/terminal.gd" type="Script" id=1] [ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1]
[ext_resource path="res://examples/asciicast/example.cast" type="Animation" id=6] [ext_resource path="res://examples/asciicast/example.cast" type="Animation" id=6]
[node name="Terminal" type="Control"] [node name="Terminal" type="Control"]

View file

@ -8,6 +8,8 @@ extends Control
# - https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html # - https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html
# - https://www.youtube.com/watch?v=jTSQlIK_92w # - https://www.youtube.com/watch?v=jTSQlIK_92w
const TPut = preload("res://addons/godot_xterm/util/tput.gd")
# Title generated using command: toilet -f pagga GODOT XTERM # Title generated using command: toilet -f pagga GODOT XTERM
const TITLE = """ const TITLE = """
\r \r
@ -36,10 +38,12 @@ var row: int
var menu_start_row: int var menu_start_row: int
var offset: int var offset: int
onready var tput = GDXterm.TPut.new($Terminal) onready var tput = TPut.new($Terminal)
func _ready(): func _ready():
if not $Terminal.is_connected("key_pressed", self, "_on_Terminal_key_pressed"):
$Terminal.connect("key_pressed", self, "_on_Terminal_key_pressed")
# warning-ignore:return_value_discarded # warning-ignore:return_value_discarded
$Terminal.connect("size_changed", self, "draw_all") $Terminal.connect("size_changed", self, "draw_all")
$Terminal.grab_focus() $Terminal.grab_focus()

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/godot_xterm/nodes/terminal/terminal.gd" type="Script" id=1] [ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1]
[ext_resource path="res://examples/menu/menu.gd" type="Script" id=2] [ext_resource path="res://examples/menu/menu.gd" type="Script" id=2]
[node name="Menu" type="Control"] [node name="Menu" type="Control"]
@ -19,4 +19,9 @@ script = ExtResource( 1 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[connection signal="key_pressed" from="Terminal" to="." method="_on_Terminal_key_pressed"] update_mode = 1
copy_on_selection = false
bell_muted = false
bell_cooldown = 0.1
blink_on_time = 0.6
blink_off_time = 0.3

View file

@ -1,4 +1,4 @@
extends "res://addons/godot_xterm/nodes/terminal/terminal.gd" extends "res://addons/godot_xterm/terminal.gd"
export (String) var exec_path := "bash" export (String) var exec_path := "bash"
export (String) var socat_path := "socat" # E.g. /usr/bin/socat export (String) var socat_path := "socat" # E.g. /usr/bin/socat

View file

@ -10,5 +10,4 @@ script = ExtResource( 1 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[connection signal="data_sent" from="." to="." method="_on_Terminal_data_sent"] [connection signal="data_sent" from="." to="." method="_on_Terminal_data_sent"]

View file

@ -1,4 +1,4 @@
extends "res://addons/godot_xterm/nodes/terminal/terminal.gd" extends "res://addons/godot_xterm/terminal.gd"
onready var pty = $PTY onready var pty = $PTY

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://themes/audio/bell.wav" type="AudioStream" id=1] [ext_resource path="res://themes/audio/bell.wav" type="AudioStream" id=1]
[ext_resource path="res://addons/godot_xterm/nodes/pty/unix/pty_unix.gd" type="Script" id=2] [ext_resource path="res://addons/godot_xterm/pty.gd" type="Script" id=2]
[ext_resource path="res://examples/terminal/terminal.gd" type="Script" id=3] [ext_resource path="res://examples/terminal/terminal.gd" type="Script" id=3]
[node name="Terminal" type="Control"] [node name="Terminal" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/godot_xterm/nodes/terminal/terminal.gd" type="Script" id=2] [ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=2]
[ext_resource path="res://examples/web_console/web_console.gd" type="Script" id=3] [ext_resource path="res://examples/web_console/web_console.gd" type="Script" id=3]
[node name="WebConsole" type="Control"] [node name="WebConsole" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0

View file

@ -8,14 +8,9 @@
config_version=4 config_version=4
_global_script_classes=[ { _global_script_classes=[ ]
"base": "Reference",
"class": "GDXterm",
"language": "GDScript",
"path": "res://addons/godot_xterm/namespace.gd"
} ]
_global_script_class_icons={ _global_script_class_icons={
"GDXterm": ""
} }
[application] [application]

View file

@ -1,8 +1,9 @@
extends "res://addons/gut/test.gd" extends "res://addons/gut/test.gd"
const LibuvUtils := preload("res://addons/godot_xterm/nodes/pty/libuv_utils.gd") const LibuvUtils := preload("res://addons/godot_xterm/nodes/pty/libuv_utils.gd")
var PTY = load("res://addons/godot_xterm/pty.gd")
var pty: GDXterm.PTYUnix var pty
var helper: Helper var helper: Helper
@ -14,7 +15,7 @@ func before_all():
func before_each(): func before_each():
pty = GDXterm.PTYUnix.new() pty = PTY.new()
add_child_autofree(pty) add_child_autofree(pty)

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/godot_xterm/nodes/terminal/terminal.gd" type="Script" id=2] [ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=2]
[ext_resource path="res://test/scenes/basic.gd" type="Script" id=3] [ext_resource path="res://test/scenes/basic.gd" type="Script" id=3]
[node name="BasicNewTerm" type="Control"] [node name="BasicNewTerm" type="Control"]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/godot_xterm/nodes/terminal/terminal.gd" type="Script" id=1] [ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1]
[ext_resource path="res://test/scenes/basic.gd" type="Script" id=2] [ext_resource path="res://test/scenes/basic.gd" type="Script" id=2]
[node name="BasicNewTerm" type="Control"] [node name="BasicNewTerm" type="Control"]

View file

@ -1,10 +1,12 @@
extends "res://addons/gut/test.gd" extends "res://addons/gut/test.gd"
var term: GDXterm.Terminal const Terminal := preload("res://addons/godot_xterm/terminal.gd")
var term: Terminal
func before_each(): func before_each():
term = GDXterm.Terminal.new() term = Terminal.new()
term.rect_size = Vector2(400, 200) term.rect_size = Vector2(400, 200)
add_child_autofree(term) add_child_autofree(term)