[Teton] Add a command to print the working directory.

This commit is contained in:
Drew Galbraith 2023-11-26 13:51:35 -08:00
parent faa54bc3dc
commit 57947fb5dd
2 changed files with 11 additions and 3 deletions

View File

@ -14,7 +14,13 @@ void Terminal::HandleCharacter(char c) {
}
void Terminal::ExecuteCommand(const glcr::String& command) {
console_.WriteString("Executing: ");
console_.WriteString(command);
console_.WriteString("\n>");
if (command == "cwd") {
console_.WriteString(cwd_);
console_.WriteChar('\n');
} else {
console_.WriteString("Unknown command: ");
console_.WriteString(command);
console_.WriteChar('\n');
}
console_.WriteChar('>');
}

View File

@ -14,4 +14,6 @@ class Terminal : public mmth::KeyboardListenerBase {
private:
Console& console_;
glcr::VariableStringBuilder current_command_;
glcr::String cwd_ = "/";
};