Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

user cant write text while choosing mode

Geo239d0feb3deb
diff --git a/src/Managers/UserInputManager.cpp b/src/Managers/UserInputManager.cpp
index 1aa86ee8..eed52952 100644
--- a/src/Managers/UserInputManager.cpp
+++ b/src/Managers/UserInputManager.cpp
@@ -91,7 +91,6 @@ bool UserInputManager::readYesNo(const std::string& label, bool def) {
}
uint8_t UserInputManager::readModeNumber() {
- std::string inputStr;
std::string inputDigit;
while (true) {
@@ -105,18 +104,6 @@ uint8_t UserInputManager::readModeNumber() {
terminalView.print(std::string(1, c));
inputDigit += c;
}
-
- inputStr += c;
- }
-
- if (inputStr.empty()) {
- return -1;
- }
-
- // Try to parse by name
- ModeEnum mode = ModeEnumMapper::fromString(inputStr);
- if (mode != ModeEnum::None) {
- return static_cast<uint8_t>(mode) + 1;
}
if (inputDigit.empty()) {
diff --git a/webui/scripts.h b/webui/scripts.h
index 03872e6f..cda7b68b 100644
--- a/webui/scripts.h
+++ b/webui/scripts.h
@@ -48,8 +48,12 @@ function sendCommand() {
pendingEchoLines = cmd.length;
input.value = "";
- output.value += cmd;
- addToHistory(cmd);
+
+ // Don't save the cmd if it just a number
+ if (!/^\d+$/.test(cmd)) {
+ output.value += cmd;
+ addToHistory(cmd);
+ }
}
// Bind Enter to sendCommand