mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
On Windows, wait until connection to bash has been established
This commit is contained in:
parent
e952c97cb6
commit
5770fa6896
1 changed files with 9 additions and 5 deletions
|
@ -26,8 +26,8 @@ func _ready():
|
||||||
else:
|
else:
|
||||||
game.toggle_music()
|
game.toggle_music()
|
||||||
|
|
||||||
|
if OS.get_name() == "Windows":
|
||||||
start_remote_shell()
|
start_remote_shell()
|
||||||
yield(get_tree().create_timer(0.1), "timeout")
|
|
||||||
global_shell = new_shell()
|
global_shell = new_shell()
|
||||||
|
|
||||||
# var cmd = global_shell.run("echo hi")
|
# var cmd = global_shell.run("echo hi")
|
||||||
|
@ -141,11 +141,15 @@ func toggle_music():
|
||||||
func shell_test(command):
|
func shell_test(command):
|
||||||
mutex.lock()
|
mutex.lock()
|
||||||
#print("go")
|
#print("go")
|
||||||
print(command)
|
#print(command)
|
||||||
var before = OS.get_ticks_msec()
|
var before = OS.get_ticks_msec()
|
||||||
|
|
||||||
|
while not $ShellServer._connected:
|
||||||
|
$ShellServer._process(0.1)
|
||||||
|
|
||||||
var response = $ShellServer.send(command)
|
var response = $ShellServer.send(command)
|
||||||
var after = OS.get_ticks_msec()
|
var after = OS.get_ticks_msec()
|
||||||
print("took " + str(after-before)+" ms")
|
#print("took " + str(after-before)+" ms")
|
||||||
#print("stop")
|
#print("stop")
|
||||||
mutex.unlock()
|
mutex.unlock()
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in a new issue