ccmake: Fix backspace key in '/' searches on macOS

Accept `getch()` return value 127 as equivalent to `KEY_BACKSPACE`
in searches as we already do in string widget values.

Fixes: #27936
This commit is contained in:
Brad King
2026-07-13 16:58:45 -04:00
parent 7738491600
commit 95dae8973c

View File

@@ -744,7 +744,8 @@ void cmCursesMainForm::HandleInput()
static_cast<std::string::size_type>(x - 10)) {
this->SearchString += static_cast<char>(key);
}
} else if (key == ctrl('h') || key == KEY_BACKSPACE || key == KEY_DC) {
} else if (key == ctrl('h') || key == 127 || key == KEY_BACKSPACE ||
key == KEY_DC) {
if (!this->SearchString.empty()) {
this->SearchString.pop_back();
}