Skip to content

Commit

Permalink
Fixed: Freeze on cin.ignore()
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed Sep 26, 2021
1 parent 528df4d commit f8cc4c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/btop_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace Input {
string get() {
string key;
while (cin.rdbuf()->in_avail() > 0 and key.size() < 100) key += cin.get();
if (cin.rdbuf()->in_avail() > 0) cin.ignore(SSmax);
if (cin.rdbuf()->in_avail() > 0) cin.ignore(cin.rdbuf()->in_avail());
if (not key.empty()) {
//? Remove escape code prefix if present
if (key.substr(0, 2) == Fx::e) {
Expand Down

0 comments on commit f8cc4c4

Please sign in to comment.