mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-24 16:20:08 +01:00
If someone tries to run an editor, use our fake-editor instead
This commit is contained in:
parent
ed7de720a9
commit
5b590b8367
2 changed files with 5 additions and 1 deletions
|
@ -50,7 +50,6 @@ func run_async_thread(shell_command):
|
||||||
env["HOME"] = game.tmp_prefix
|
env["HOME"] = game.tmp_prefix
|
||||||
env["PATH"] = game.tmp_prefix+":/usr/bin:/bin:/mingw64/bin/"
|
env["PATH"] = game.tmp_prefix+":/usr/bin:/bin:/mingw64/bin/"
|
||||||
|
|
||||||
|
|
||||||
var hacky_command = ""
|
var hacky_command = ""
|
||||||
for variable in env:
|
for variable in env:
|
||||||
hacky_command += "export %s='%s';" % [variable, env[variable]]
|
hacky_command += "export %s='%s';" % [variable, env[variable]]
|
||||||
|
|
|
@ -80,6 +80,11 @@ func send_command(command):
|
||||||
input.editable = false
|
input.editable = false
|
||||||
completions.hide()
|
completions.hide()
|
||||||
|
|
||||||
|
# If someone tries to run an editor, use fake-editor instead.
|
||||||
|
var editor_regex = RegEx.new()
|
||||||
|
editor_regex.compile("^(vim?|gedit|emacs|kate|nano|code) ")
|
||||||
|
command = editor_regex.sub(command, "fake-editor ")
|
||||||
|
|
||||||
var cmd = repository.shell.run_async(command, false)
|
var cmd = repository.shell.run_async(command, false)
|
||||||
yield(cmd, "done")
|
yield(cmd, "done")
|
||||||
call_deferred("command_done", cmd)
|
call_deferred("command_done", cmd)
|
||||||
|
|
Loading…
Reference in a new issue