1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 21:32:13 +03:00

key assignment and docs for ShowDebugOverlay

refs: https://github.com/wez/wezterm/issues/641
This commit is contained in:
Wez Furlong 2021-05-29 12:39:13 -07:00
parent 439fd5145d
commit cb4da18021
5 changed files with 21 additions and 1 deletions

View File

@ -301,6 +301,7 @@ impl InputMap {
KeyCode::Char('F'),
Search(Pattern::CaseSensitiveString("".into()))
],
[Modifiers::CTRL, KeyCode::Char('L'), ShowDebugOverlay],
[ctrl_shift, KeyCode::Char(' '), QuickSelect],
// Font size manipulation
[Modifiers::CTRL, KeyCode::Char('-'), DecreaseFontSize],

View File

@ -34,6 +34,7 @@ As features stabilize some brief notes about them will accumulate here.
* Fixed: splitting panes in multiplexer could fail after a network reconnect [#781](https://github.com/wez/wezterm/issues/781)
* Fixed: multiplexer now propagates toast notifications and color palette to client [#489](https://github.com/wez/wezterm/issues/489) [#748](https://github.com/wez/wezterm/issues/748)
* Fixed: neovim interprets drags as double clicks [#823](https://github.com/wez/wezterm/discussions/823)
* New: `CTRL+SHIFT+L` is assigned to [ShowDebugOverlay](config/lua/keyassignment/ShowDebugOverlay.md) [#641](https://github.com/wez/wezterm/issues/641)
### 20210502-154244-3f7122cb

View File

@ -169,6 +169,7 @@ The default key bindings are:
| `SUPER` | `h` | `HideApplication` (macOS only) |
| `SUPER` | `k` | `ClearScrollback="ScrollbackOnly"` |
| `CTRL+SHIFT` | `K` | `ClearScrollback="ScrollbackOnly"` |
| `CTRL+SHIFT` | `L` | `ShowDebugOverlay` (*since: nightly builds only*)|
| `SUPER` | `f` | `Search={CaseSensitiveString=""}` |
| `CTRL+SHIFT` | `F` | `Search={CaseSensitiveString=""}` |
| `CTRL+SHIFT` | `X` | `ActivateCopyMode` |

View File

@ -0,0 +1,15 @@
# `ShowDebugOverlay`
*Since: nightly builds only*
Overlays the current tab with the debug overlay, which is a combination
of a debug log and a lua [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop).
The REPL has the following globals available:
* `wezterm` - the [wezterm](../wezterm/index.md) module is pre-imported
* `window` - the [window](../window/index.md) object for the current window
The lua context in the REPL is not connected to any global state; you cannot use it
to dynamically assign event handlers for example. It is primarily useful for
prototyping lua snippets before you integrate them fully into your config.

View File

@ -131,10 +131,12 @@ pub fn show_debug_overlay(mut term: TermWizTerminal, gui_win: GuiWin) -> anyhow:
loop {
print_new_log_entries(&mut term, &mut latest_log_entry)?;
let mut editor = LineEditor::new(&mut term);
editor.set_prompt("> ");
if let Some(line) = editor.read_line(&mut host)? {
if line.is_empty() {
continue;
}
host.history().add(&line);
let expr = format!("return {}", line);