(&self, scope: Scope<'_>)
| 242 | } |
| 243 | |
| 244 | async fn async_exec(&self, scope: Scope<'_>) -> CallResult<()> { |
| 245 | debug_assert_eq!(0, scope.nargs()); |
| 246 | |
| 247 | let key = self.console.borrow_mut().poll_key().await?; |
| 248 | let key_name = match key { |
| 249 | Some(Key::ArrowDown) => "DOWN".to_owned(), |
| 250 | Some(Key::ArrowLeft) => "LEFT".to_owned(), |
| 251 | Some(Key::ArrowRight) => "RIGHT".to_owned(), |
| 252 | Some(Key::ArrowUp) => "UP".to_owned(), |
| 253 | |
| 254 | Some(Key::Backspace) => "BS".to_owned(), |
| 255 | Some(Key::CarriageReturn) => "ENTER".to_owned(), |
| 256 | Some(Key::Char(x)) => format!("{}", x), |
| 257 | Some(Key::Delete) => "DEL".to_owned(), |
| 258 | Some(Key::End) => "END".to_owned(), |
| 259 | Some(Key::EofOrDelete) => "EOF".to_owned(), |
| 260 | Some(Key::Escape) => "ESC".to_owned(), |
| 261 | Some(Key::Home) => "HOME".to_owned(), |
| 262 | Some(Key::Interrupt) => "INT".to_owned(), |
| 263 | Some(Key::NewLine) => "ENTER".to_owned(), |
| 264 | Some(Key::PageDown) => "PGDOWN".to_owned(), |
| 265 | Some(Key::PageUp) => "PGUP".to_owned(), |
| 266 | Some(Key::Tab) => "TAB".to_owned(), |
| 267 | Some(Key::Unknown) => "?".to_owned(), |
| 268 | |
| 269 | None => "".to_owned(), |
| 270 | }; |
| 271 | scope.return_string(key_name) |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | /// The `INPUT` command. |
nothing calls this directly
no test coverage detected