mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-06-29 02:35:31 +02:00
added windows pty support
This commit is contained in:
parent
bd26137e78
commit
f3820365c6
23 changed files with 1478 additions and 695 deletions
|
@ -145,17 +145,6 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
|
|||
$Terminal.grab_focus()
|
||||
scene.queue_free()
|
||||
"Terminal":
|
||||
if OS.get_name() == "Windows":
|
||||
OS.call_deferred(
|
||||
"alert",
|
||||
(
|
||||
"Psuedoterminal node currently"
|
||||
+ " uses pty.h but needs to use either winpty or conpty"
|
||||
+ " to work on Windows."
|
||||
),
|
||||
"Terminal not Supported on Windows"
|
||||
)
|
||||
return
|
||||
var scene = item.scene.instantiate()
|
||||
var pty = scene if OS.has_feature("web") else scene.get_node("PTY")
|
||||
add_child(scene)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://brjrtf5fpptw8"]
|
||||
|
||||
[ext_resource type="Script" path="res://examples/menu/menu.gd" id="2"]
|
||||
[ext_resource type="Theme" uid="uid://0gk8swmcldbg" path="res://themes/demo.tres" id="2_7f2wl"]
|
||||
[ext_resource type="Theme" uid="uid://0gk8swmcldbg" path="res://themes/demo.tres" id="2_pr2sv"]
|
||||
|
||||
[node name="Menu" type="Control"]
|
||||
layout_mode = 3
|
||||
|
@ -19,4 +19,4 @@ anchor_right = 1.0
|
|||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("2_7f2wl")
|
||||
theme = ExtResource("2_pr2sv")
|
||||
|
|
|
@ -2,6 +2,5 @@ extends Terminal
|
|||
|
||||
@onready var pty = $PTY
|
||||
|
||||
|
||||
func _ready():
|
||||
pty.fork(OS.get_environment("SHELL"))
|
||||
pty.fork()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue