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

Method handle_gateways_key

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

Source from the content-addressed store, hash-verified

1133 }
1134
1135 fn handle_gateways_key(&mut self, key: KeyEvent) {
1136 match key.code {
1137 KeyCode::Char('q') => self.running = false,
1138 KeyCode::Tab => self.focus = Focus::Providers,
1139 KeyCode::BackTab => self.focus = Focus::Sandboxes,
1140 KeyCode::Char(':') => {
1141 self.input_mode = InputMode::Command;
1142 self.command_input.clear();
1143 }
1144 KeyCode::Char('j') | KeyCode::Down if !self.gateways.is_empty() => {
1145 self.gateway_selected = (self.gateway_selected + 1).min(self.gateways.len() - 1);
1146 }
1147 KeyCode::Char('k') | KeyCode::Up => {
1148 self.gateway_selected = self.gateway_selected.saturating_sub(1);
1149 }
1150 KeyCode::Enter => {
1151 if let Some(entry) = self.gateways.get(self.gateway_selected) {
1152 if entry.name != self.gateway_name {
1153 self.pending_gateway_switch = Some(entry.name.clone());
1154 }
1155 self.focus = Focus::Providers;
1156 }
1157 }
1158 _ => {}
1159 }
1160 }
1161
1162 fn handle_providers_key(&mut self, key: KeyEvent) {
1163 if self.confirm_provider_delete {

Callers 1

handle_normal_keyMethod · 0.80

Calls 4

lenMethod · 0.80
clearMethod · 0.45
is_emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected