Merge pull request #7536 from jtbx/scrollback-history

Show previous commands in the console's scrollback buffer
This commit is contained in:
heinrich5991 2023-11-23 23:52:17 +00:00 committed by GitHub
commit cb22fbf902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -254,6 +254,10 @@ bool CGameConsole::CInstance::OnInput(const IInput::CEvent &Event)
{
char *pEntry = m_History.Allocate(m_Input.GetLength() + 1);
str_copy(pEntry, m_Input.GetString(), m_Input.GetLength() + 1);
// print out the user's commands before they get run
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "> %s", m_Input.GetString());
m_pGameConsole->PrintLine(m_Type, aBuf);
}
}
ExecuteLine(m_Input.GetString());