mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-08 06:43:51 +00:00
Strip ".lua" from program names in multishell title bar
This commit is contained in:
parent
25a18ee33a
commit
05e838ca5a
@ -37,13 +37,21 @@ local function run( _sCommand, ... )
|
|||||||
if sPath ~= nil then
|
if sPath ~= nil then
|
||||||
tProgramStack[#tProgramStack + 1] = sPath
|
tProgramStack[#tProgramStack + 1] = sPath
|
||||||
if multishell then
|
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
|
end
|
||||||
local result = os.run( tEnv, sPath, ... )
|
local result = os.run( tEnv, sPath, ... )
|
||||||
tProgramStack[#tProgramStack] = nil
|
tProgramStack[#tProgramStack] = nil
|
||||||
if multishell then
|
if multishell then
|
||||||
if #tProgramStack > 0 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
|
else
|
||||||
multishell.setTitle( multishell.getCurrent(), "shell" )
|
multishell.setTitle( multishell.getCurrent(), "shell" )
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user