diff --git a/src/btop_input.cpp b/src/btop_input.cpp index 5ee98d4..70ef08e 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -122,7 +122,7 @@ namespace Input { string key = input; if (not key.empty()) { //? Remove escape code prefix if present - if (key.substr(0, 2) == Fx::e) { + if (key.length() > 1 and key.at(0) == Fx::e.at(0)) { key.erase(0, 1); } //? Detect if input is an mouse event