Skip to content

Commit

Permalink
Make Console Input Line return to a blank line after moving through h…
Browse files Browse the repository at this point in the history
…istory

This makes the behavior closer to a terminal emulator/shell
  • Loading branch information
RunningDroid committed May 23, 2023
1 parent e5b4159 commit c3db8b8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions objects/ConsoleInputLine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ function ConsoleInputLine:update(dt)
if input:pressed('down') and not self.console.bytepath_main_active then
if #command_history > 0 then
command_history_index = command_history_index + 1
if command_history_index > #command_history then command_history_index = #command_history end
self.text = '[;root,]arch~ ' .. command_history[command_history_index]
self:setCharacters()
if command_history_index > #command_history then
command_history_index = #command_history + 1
self.text = '[;root,]arch~ '
self:setCharacters()
else
self.text = '[;root,]arch~ ' .. command_history[command_history_index]
self:setCharacters()
end
end
end
end
Expand Down

0 comments on commit c3db8b8

Please sign in to comment.