mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-13 11:40:29 +00:00
Do not insert empty or duplicate entries into shell history
If a string is empty or the same as the previous command then it will not be inserted into history.
This commit is contained in:
parent
25128dfb66
commit
9908f8c289
@ -44,7 +44,9 @@ while bRunning do
|
||||
end
|
||||
return nil
|
||||
end )
|
||||
table.insert( tCommandHistory, s )
|
||||
if s:match("%S") and tCommandHistory[#tCommandHistory] ~= s then
|
||||
table.insert( tCommandHistory, s )
|
||||
end
|
||||
|
||||
local nForcePrint = 0
|
||||
local func, e = load( s, "lua", "t", tEnv )
|
||||
|
@ -363,7 +363,9 @@ else
|
||||
else
|
||||
sLine = read( nil, tCommandHistory )
|
||||
end
|
||||
table.insert( tCommandHistory, sLine )
|
||||
if sLine:match("%S") and tCommandHistory[#tCommandHistory] ~= sLine then
|
||||
table.insert( tCommandHistory, sLine )
|
||||
end
|
||||
shell.run( sLine )
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user