diff --git a/interpreters/estrelashell.lua b/interpreters/estrelashell.lua index 39bed18bfe..2770405ed8 100644 --- a/interpreters/estrelashell.lua +++ b/interpreters/estrelashell.lua @@ -7,7 +7,7 @@ return { local bottomnotebook = ide.frame.bottomnotebook bottomnotebook:SetSelection(1) - ShellExecuteCode(wfilename) + ShellExecuteFile(wfilename) end, fprojdir = function(self,wfilename) return wfilename:GetPath(wx.wxPATH_GET_VOLUME) diff --git a/src/editor/shellbox.lua b/src/editor/shellbox.lua index d29708c64f..a8db68e793 100644 --- a/src/editor/shellbox.lua +++ b/src/editor/shellbox.lua @@ -238,7 +238,6 @@ local env = createenv() local function executeShellCode(tx) if tx == nil or tx == '' then return end - DisplayShellDirect('\n') DisplayShellPrompt('') local addedret = false @@ -277,13 +276,18 @@ function ShellSupportRemote(client,uid) client and "Remote console" or "Local console") end -function ShellExecuteCode(wfilename) +function ShellExecuteFile(wfilename) if (not wfilename) then return end local cmd = 'dofile([['..wfilename:GetFullPath()..']])' DisplayShellDirect(cmd) executeShellCode(cmd) end +function ShellExecuteCode(code) + DisplayShellDirect(code) + executeShellCode(code) +end + local function displayShellIntro() DisplayShellDirect([[Welcome to the interactive Lua interpreter. Enter Lua code and press Enter to run it. Use Shift-Enter for multiline code. @@ -350,6 +354,7 @@ out:Connect(wx.wxEVT_KEY_DOWN, out:ClearAll() displayShellIntro() else + DisplayShellDirect('\n') executeShellCode(promptText) end currentHistory = getPromptLine() -- reset history