MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / handle_command_key

Method handle_command_key

crates/openshell-tui/src/app.rs:2476–2493  ·  view source on GitHub ↗
(&mut self, key: KeyEvent)

Source from the content-addressed store, hash-verified

2474 }
2475
2476 fn handle_command_key(&mut self, key: KeyEvent) {
2477 match key.code {
2478 KeyCode::Esc => {
2479 self.input_mode = InputMode::Normal;
2480 self.command_input.clear();
2481 }
2482 KeyCode::Enter => {
2483 self.execute_command();
2484 self.input_mode = InputMode::Normal;
2485 self.command_input.clear();
2486 }
2487 KeyCode::Char(c) => self.command_input.push(c),
2488 KeyCode::Backspace => {
2489 self.command_input.pop();
2490 }
2491 _ => {}
2492 }
2493 }
2494
2495 fn execute_command(&mut self) {
2496 let cmd = self.command_input.trim();

Callers 1

handle_keyMethod · 0.80

Calls 3

execute_commandMethod · 0.80
pushMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected