Remove references to terminal.gd

This commit is contained in:
Leroy Hopson 2023-01-21 11:20:44 +13:00
parent e563a15ce2
commit 15e5b2b8c7
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
10 changed files with 68 additions and 135 deletions

View file

@ -1,6 +1,5 @@
[gd_scene load_steps=3 format=3 uid="uid://d3xc4utggdchf"] [gd_scene load_steps=2 format=3 uid="uid://d3xc4utggdchf"]
[ext_resource type="Script" path="res://addons/godot_xterm/terminal.gd" id="2"]
[ext_resource type="Script" path="res://examples/web_console/web_console.gd" id="3"] [ext_resource type="Script" path="res://examples/web_console/web_console.gd" id="3"]
[node name="WebConsole" type="Control"] [node name="WebConsole" type="Control"]
@ -12,9 +11,7 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("3") script = ExtResource("3")
[node name="Terminal" type="Control" parent="."] [node name="Terminal" type="Terminal" parent="."]
anchors_preset = 0 layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
focus_mode = 2
script = ExtResource("2")

View file

@ -1,7 +1,5 @@
extends "res://addons/gut/test.gd" extends "res://addons/gut/test.gd"
const Terminal := preload("res://addons/godot_xterm/terminal.gd")
var terminal: Terminal var terminal: Terminal
@ -42,7 +40,6 @@ func test_writing_random_data_to_terminal_does_not_crash_application():
class TestTheme: class TestTheme:
extends "res://addons/gut/test.gd" extends "res://addons/gut/test.gd"
const Terminal := preload("res://addons/godot_xterm/terminal.gd")
const TestScene := preload("../scenes/theme.tscn") const TestScene := preload("../scenes/theme.tscn")
const default_theme := preload("res://addons/godot_xterm/themes/default.tres") const default_theme := preload("res://addons/godot_xterm/themes/default.tres")

View file

@ -175,7 +175,6 @@ class TestPTYSize:
# See: https://github.com/lihop/godot-xterm/issues/56 # See: https://github.com/lihop/godot-xterm/issues/56
const PTY := preload("res://addons/godot_xterm/pty.gd") const PTY := preload("res://addons/godot_xterm/pty.gd")
const Terminal := preload("res://addons/godot_xterm/terminal.gd")
var pty: PTY var pty: PTY
var terminal: Terminal var terminal: Terminal

View file

@ -1,29 +1,22 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=2 format=3 uid="uid://bk8v3o87tcdp3"]
[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=2] [ext_resource type="Script" path="res://test/scenes/basic.gd" id="3"]
[ext_resource path="res://test/scenes/basic.gd" type="Script" id=3]
[node name="BasicNewTerm" type="Control"] [node name="BasicNewTerm" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 43.0 offset_right = 43.0
offset_bottom = 43.0 offset_bottom = 43.0
script = ExtResource( 3 ) script = ExtResource("3")
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ColorRect" type="ColorRect" parent="."] [node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 0
offset_right = 40.0 offset_right = 40.0
offset_bottom = 40.0 offset_bottom = 40.0
color = Color( 0, 1, 0, 1 ) color = Color(0, 1, 0, 1)
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Terminal" type="Control" parent="."] [node name="Terminal" type="Terminal" parent="."]
layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
focus_mode = 1 focus_mode = 1
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -1,21 +1,16 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=2 format=3 uid="uid://bo7q8qjwr52t0"]
[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1] [ext_resource type="Script" path="res://test/scenes/basic.gd" id="2"]
[ext_resource path="res://test/scenes/basic.gd" type="Script" id=2]
[node name="BasicNewTerm" type="Control"] [node name="BasicNewTerm" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 2 ) script = ExtResource("2")
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Terminal" type="Control" parent="."] [node name="Terminal" type="Terminal" parent="."]
layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
focus_mode = 1 focus_mode = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -1,50 +1,34 @@
[gd_scene load_steps=2 format=2] [gd_scene format=3 uid="uid://hc4uloxp4q2o"]
[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1]
[node name="HBoxContainer" type="HBoxContainer"] [node name="HBoxContainer" type="HBoxContainer"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
[node name="HBoxContainer" type="HBoxContainer" parent="."] [node name="HBoxContainer" type="HBoxContainer" parent="."]
offset_right = 1024.0 layout_mode = 2
offset_bottom = 600.0
size_flags_horizontal = 3 size_flags_horizontal = 3
[node name="TextEdit" type="TextEdit" parent="HBoxContainer"] [node name="TextEdit" type="TextEdit" parent="HBoxContainer"]
offset_right = 338.0 layout_mode = 2
offset_bottom = 600.0
size_flags_horizontal = 3 size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
offset_left = 342.0 layout_mode = 2
offset_right = 681.0
offset_bottom = 600.0
size_flags_horizontal = 3 size_flags_horizontal = 3
[node name="TextEdit3" type="TextEdit" parent="HBoxContainer/VBoxContainer"] [node name="TextEdit3" type="TextEdit" parent="HBoxContainer/VBoxContainer"]
offset_right = 339.0 layout_mode = 2
offset_bottom = 197.0
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Terminal" type="Control" parent="HBoxContainer/VBoxContainer"] [node name="Terminal" type="Terminal" parent="HBoxContainer/VBoxContainer"]
offset_top = 201.0 layout_mode = 2
offset_right = 339.0
offset_bottom = 398.0
focus_mode = 2
size_flags_vertical = 3 size_flags_vertical = 3
script = ExtResource( 1 )
[node name="TextEdit2" type="TextEdit" parent="HBoxContainer/VBoxContainer"] [node name="TextEdit2" type="TextEdit" parent="HBoxContainer/VBoxContainer"]
offset_top = 402.0 layout_mode = 2
offset_right = 339.0
offset_bottom = 600.0
size_flags_vertical = 3 size_flags_vertical = 3
[node name="TextEdit2" type="TextEdit" parent="HBoxContainer"] [node name="TextEdit2" type="TextEdit" parent="HBoxContainer"]
offset_left = 685.0 layout_mode = 2
offset_right = 1024.0
offset_bottom = 600.0
size_flags_horizontal = 3 size_flags_horizontal = 3
[connection signal="data_sent" from="HBoxContainer/VBoxContainer/Terminal" to="HBoxContainer/VBoxContainer/Terminal" method="write"]

View file

@ -1,88 +1,67 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=2 format=3 uid="uid://31l3ufwtaidn"]
[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1] [ext_resource type="Script" path="res://addons/godot_xterm/pty.gd" id="2"]
[ext_resource path="res://addons/godot_xterm/pty.gd" type="Script" id=2]
[node name="PTYandTerminal" type="Node"] [node name="PTYandTerminal" type="Node"]
[node name="PTYChild" type="Node" parent="."] [node name="PTYChild" type="Node" parent="."]
[node name="Terminal" type="Control" parent="PTYChild"] [node name="Terminal" type="Terminal" parent="PTYChild"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="PTY" type="Node" parent="PTYChild/Terminal"] [node name="PTY" type="Node" parent="PTYChild/Terminal"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("..") terminal_path = NodePath("..")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}
[node name="PTYSiblingAbove" type="Node" parent="."] [node name="PTYSiblingAbove" type="Node" parent="."]
[node name="PTY" type="Node" parent="PTYSiblingAbove"] [node name="PTY" type="Node" parent="PTYSiblingAbove"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("../Terminal") terminal_path = NodePath("../Terminal")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}
[node name="Terminal" type="Control" parent="PTYSiblingAbove"] [node name="Terminal" type="Terminal" parent="PTYSiblingAbove"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="PTYSiblingBelow" type="Node" parent="."] [node name="PTYSiblingBelow" type="Node" parent="."]
[node name="Terminal" type="Control" parent="PTYSiblingBelow"] [node name="Terminal" type="Terminal" parent="PTYSiblingBelow"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="PTY" type="Node" parent="PTYSiblingBelow"] [node name="PTY" type="Node" parent="PTYSiblingBelow"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("../Terminal") terminal_path = NodePath("../Terminal")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}
[node name="PTYCousinAbove" type="Node" parent="."] [node name="PTYCousinAbove" type="Node" parent="."]
[node name="Node" type="Node" parent="PTYCousinAbove"] [node name="Node" type="Node" parent="PTYCousinAbove"]
[node name="PTY" type="Node" parent="PTYCousinAbove/Node"] [node name="PTY" type="Node" parent="PTYCousinAbove/Node"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("../../Terminal") terminal_path = NodePath("../../Terminal")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}
[node name="Terminal" type="Control" parent="PTYCousinAbove"] [node name="Terminal" type="Terminal" parent="PTYCousinAbove"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="PTYCousinBelow" type="Node" parent="."] [node name="PTYCousinBelow" type="Node" parent="."]
[node name="Terminal" type="Control" parent="PTYCousinBelow"] [node name="Terminal" type="Terminal" parent="PTYCousinBelow"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="Node" type="Node" parent="PTYCousinBelow"] [node name="Node" type="Node" parent="PTYCousinBelow"]
[node name="PTY" type="Node" parent="PTYCousinBelow/Node"] [node name="PTY" type="Node" parent="PTYCousinBelow/Node"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("../../Terminal") terminal_path = NodePath("../../Terminal")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}
[node name="PTYCousinAbove2" type="Node" parent="."] [node name="PTYCousinAbove2" type="Node" parent="."]
@ -91,41 +70,37 @@ env = {
[node name="Node" type="Node" parent="PTYCousinAbove2/Node"] [node name="Node" type="Node" parent="PTYCousinAbove2/Node"]
[node name="PTY" type="Node" parent="PTYCousinAbove2/Node/Node"] [node name="PTY" type="Node" parent="PTYCousinAbove2/Node/Node"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("../../../Control/Terminal") terminal_path = NodePath("../../../Control/Terminal")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}
[node name="Control" type="Control" parent="PTYCousinAbove2"] [node name="Control" type="Control" parent="PTYCousinAbove2"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
[node name="Terminal" type="Control" parent="PTYCousinAbove2/Control"] [node name="Terminal" type="Terminal" parent="PTYCousinAbove2/Control"]
layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="PTYCousinBelow2" type="Node" parent="."] [node name="PTYCousinBelow2" type="Node" parent="."]
[node name="Control" type="Control" parent="PTYCousinBelow2"] [node name="Control" type="Control" parent="PTYCousinBelow2"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
[node name="Terminal" type="Control" parent="PTYCousinBelow2/Control"] [node name="Terminal" type="Terminal" parent="PTYCousinBelow2/Control"]
layout_mode = 0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="Node" type="Node" parent="PTYCousinBelow2"] [node name="Node" type="Node" parent="PTYCousinBelow2"]
[node name="Node" type="Node" parent="PTYCousinBelow2/Node"] [node name="Node" type="Node" parent="PTYCousinBelow2/Node"]
[node name="PTY" type="Node" parent="PTYCousinBelow2/Node/Node"] [node name="PTY" type="Node" parent="PTYCousinBelow2/Node/Node"]
script = ExtResource( 2 ) script = ExtResource("2")
terminal_path = NodePath("../../../Control/Terminal") terminal_path = NodePath("../../../Control/Terminal")
env = {
"COLORTERM": "truecolor",
"TERM": "xterm-256color"
}

View file

@ -1,7 +1,5 @@
@tool @tool
extends "res://addons/godot_xterm/terminal.gd" extends Terminal
signal theme_changed
func _ready(): func _ready():
@ -24,10 +22,3 @@ func _ready():
write("\u001b[1mL\u001b[0m") # Bold. write("\u001b[1mL\u001b[0m") # Bold.
write("\u001b[3mL\u001b[0m") # Italic. write("\u001b[3mL\u001b[0m") # Italic.
write("\u001b[1m\u001b[3mL\u001b[0m") # Bold Italic. write("\u001b[1m\u001b[3mL\u001b[0m") # Bold Italic.
func _notification(what):
super._notification(what)
match what:
NOTIFICATION_THEME_CHANGED:
call_deferred("emit_signal", "theme_changed")

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=3 uid="uid://dntcn0ixbgikx"]
[ext_resource path="res://test/scenes/theme.gd" type="Script" id=1] [ext_resource type="Script" path="res://test/scenes/theme.gd" id="1"]
[node name="Terminal" type="Control"] [node name="Terminal" type="Terminal"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 ) script = ExtResource("1")

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=3 uid="uid://y1f8mwiknqcm"]
[sub_resource type="GDScript" id=1] [sub_resource type="GDScript" id="GDScript_wc7yv"]
script/source = "extends \"res://addons/godot_xterm/terminal.gd\" script/source = "extends Terminal
var rng := RandomNumberGenerator.new() var rng := RandomNumberGenerator.new()
@ -15,7 +15,8 @@ func _process(_delta):
write(PackedByteArray([rng.randi() % 256])) write(PackedByteArray([rng.randi() % 256]))
" "
[node name="Terminal" type="Control"] [node name="Terminal" type="Terminal"]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = SubResource( 1 ) script = SubResource("GDScript_wc7yv")