From 8198921b1a578c62ed87a7ea5f162ff5e7eee6df Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Thu, 1 Oct 2020 10:07:36 +0200 Subject: [PATCH] Fix sandbox mode by connecting the terminal's signal --- repository.gd | 13 +++++++------ sandbox.gd | 5 +++++ sandbox.tscn | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/repository.gd b/repository.gd index 9398003..a07d42a 100644 --- a/repository.gd +++ b/repository.gd @@ -69,12 +69,13 @@ func set_path(new_path): path = new_path if path_node: path_node.text = path - shell.cd(new_path) - for o in objects.values(): - o.queue_free() - objects = {} - if is_inside_tree(): - update_everything() + if new_path != "": + shell.cd(new_path) + for o in objects.values(): + o.queue_free() + objects = {} + if is_inside_tree(): + update_everything() func get_path(): return path diff --git a/sandbox.gd b/sandbox.gd index b06fca3..069489e 100644 --- a/sandbox.gd +++ b/sandbox.gd @@ -26,3 +26,8 @@ func _ready(): $Columns/Repository.path = path get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, Vector2(1920, 1080), 1.5) + + $Columns/Terminal.repository = $Columns/Repository + +func update_repo(): + $Columns/Repository.update_everything() diff --git a/sandbox.tscn b/sandbox.tscn index 910bb5b..a6d25d5 100644 --- a/sandbox.tscn +++ b/sandbox.tscn @@ -49,3 +49,4 @@ margin_left = 961.0 margin_right = 1910.0 margin_bottom = 1070.0 size_flags_horizontal = 3 +[connection signal="command_done" from="Columns/Terminal" to="." method="update_repo"]