1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-12 11:10:29 +00:00

Strip ".lua" from program names in multishell title bar

This commit is contained in:
Daniel Ratcliffe 2017-05-17 19:05:45 +01:00
parent 25a18ee33a
commit 05e838ca5a

View File

@ -37,13 +37,21 @@ local function run( _sCommand, ... )
if sPath ~= nil then
tProgramStack[#tProgramStack + 1] = sPath
if multishell then
multishell.setTitle( multishell.getCurrent(), fs.getName( sPath ) )
local sTitle = fs.getName( sPath )
if sTitle:sub(-4) == ".lua" then
sTitle = sTitle:sub(1,-5)
end
multishell.setTitle( multishell.getCurrent(), sTitle )
end
local result = os.run( tEnv, sPath, ... )
tProgramStack[#tProgramStack] = nil
if multishell then
if #tProgramStack > 0 then
multishell.setTitle( multishell.getCurrent(), fs.getName( tProgramStack[#tProgramStack] ) )
local sTitle = fs.getName( tProgramStack[#tProgramStack] )
if sTitle:sub(-4) == ".lua" then
sTitle = sTitle:sub(1,-5)
end
multishell.setTitle( multishell.getCurrent(), sTitle )
else
multishell.setTitle( multishell.getCurrent(), "shell" )
end