wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.72k stars 793 forks source link

Paste not working when `wezterm connect unix_domain` from local WSL2 #3968

Open majian4work opened 1 year ago

majian4work commented 1 year ago

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

I'm also use wslg on wsl2, seem it's using wayland( don't known how to check)

WezTerm version

20230408-112425-69ae8472

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below

Describe the bug

I used WSL2 on Windows 11, so I put wezterm config on /mnt/c/Users/xxx/.config/wezterm for windows gui and /home/dev/.config/wezterm for wsl2. and config the default_domain to WSL, so I can launch WSL shell directly.

  if wezterm.target_triple == "x86_64-pc-windows-msvc" then
    config.default_domain = "WSL:Ubuntu"
  end

Because wezterm ssh SSHMUX:xxx seems not support ProxyCommand, I have added unix_domains from ~/.ssh/config in my wezterm config file

  local unix_domains = {}
  for name, _ in pairs(wezterm.enumerate_ssh_hosts()) do
    table.insert(unix_domains, {
      name = name,
      -- should install wezterm binary in system path(eg. /usr/bin/wezterm)
      proxy_command = { "ssh", "-T", "-A", name, "wezterm", "cli", "proxy" },
    })
  end
  config.unix_domains = unix_domains

and then wezterm connect xxx from windows gui (Term 1) succeed. and a new gui from wls2 was created(Term2) which running the remote shell. Right mouse click or "LEADER-v" to paste from clipboard (which is workable on local) not workable on Term2. I can confirm that copy is workable. (I can copy from "Term 2", and paste to other place include Term 1. but I can't paster to Term 2)

my mouse and key config, it's same on local (include windows and wsl) and remote

local wezterm = require("wezterm")
local act = wezterm.action
local M = {}

function M.setup(config)
  config.mouse_bindings = {
    -- Change the default click behavior so that it only selects
    -- text and doesn't open hyperlinks
    {
      event = { Up = { streak = 1, button = "Left" } },
      mods = "NONE",
      action = act.CompleteSelection("PrimarySelection"),
    },
    -- select to copy(not wezterm copy mode), and paste if don't select anything
    {
      event = { Down = { streak = 1, button = "Right" } },
      mods = "NONE",
      action = wezterm.action_callback(function(window, pane)
        local has_selection = window:get_selection_text_for_pane(pane) ~= ""
        if has_selection then
          window:perform_action(act.CopyTo("ClipboardAndPrimarySelection"), pane)
          window:perform_action(act.ClearSelection, pane)
        else
          window:perform_action(act.PasteFrom("Clipboard"), pane)
        end
      end),
    },
    -- CTRL-Click open hyperlinks
    {
      event = { Up = { streak = 1, button = "Left" } },
      mods = "CTRL",
      action = act.OpenLinkAtMouseCursor,
    },
    -- Disable the 'Down' event of CTRL-Click to avoid weird program behaviors
    -- https://wezfurlong.org/wezterm/config/mouse.html?highlight=Ctrl-click#gotcha-on-binding-an-up-event-only
    {
      event = { Down = { streak = 1, button = "Left" } },
      mods = "CTRL",
      action = act.Nop,
    },
    -- Grap the semantic zone when triple click
    {
      event = { Down = { streak = 3, button = "Left" } },
      mode = "NONE",
      action = act.SelectTextAtMouseCursor("SemanticZone"),
    },
  }
end

return M
local wezterm = require("wezterm")
local act = wezterm.action
local M = {}

function M.setup(config)
  config.disable_default_key_bindings = true
  config.use_dead_keys = false -- Allow using ^ with single key press.
  config.leader = { key = "a", mods = "CTRL" }
  config.keys = {
    -- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A
    { key = "a", mods = "LEADER|CTRL", action = act.SendString("\x01") },
    -- workspace
    { key = "l", mods = "SHIFT|ALT", action = act.ShowLauncherArgs({ flags = "FUZZY|WORKSPACES" }) },
    { key = "n", mods = "SHIFT|ALT", action = act.SwitchWorkspaceRelative(1) },
    { key = "p", mods = "SHIFT|ALT", action = act.SwitchWorkspaceRelative(-1) },
    -- window
    { key = "l", mods = "SHIFT|CTRL", action = act.ShowLauncher },
    { key = "Enter", mods = "SHIFT|CTRL", action = act.ToggleFullScreen },
    { key = "p", mods = "SHIFT|CTRL", action = act.ActivateCommandPalette },
    { key = "d", mods = "SHIFT|CTRL", action = act.ShowDebugOverlay },
    { key = "+", mods = "SHIFT|CTRL", action = act.IncreaseFontSize },
    { key = "-", mods = "SHIFT|CTRL", action = act.DecreaseFontSize },
    { key = "=", mods = "CTRL", action = act.ResetFontSize },
    -- tab
    { key = "t", mods = "LEADER", action = act.SpawnTab("CurrentPaneDomain") },
    { key = "q", mods = "LEADER", action = act.CloseCurrentTab({ confirm = true }) },
    { key = "1", mods = "LEADER", action = act.ActivateTab(0) },
    { key = "2", mods = "LEADER", action = act.ActivateTab(1) },
    { key = "3", mods = "LEADER", action = act.ActivateTab(2) },
    { key = "4", mods = "LEADER", action = act.ActivateTab(3) },
    { key = "5", mods = "LEADER", action = act.ActivateTab(4) },
    { key = "6", mods = "LEADER", action = act.ActivateTab(5) },
    { key = "7", mods = "LEADER", action = act.ActivateTab(6) },
    { key = "8", mods = "LEADER", action = act.ActivateTab(7) },
    { key = "9", mods = "LEADER", action = act.ActivateTab(-1) },
    -- pane
    { key = "x", mods = "LEADER", action = act.CloseCurrentPane({ confirm = true }) },
    { key = "z", mods = "LEADER", action = act.TogglePaneZoomState },
    { key = "-", mods = "LEADER", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
    { key = "\\", mods = "LEADER", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
    { key = "f", mods = "LEADER", action = act.Search("CurrentSelectionOrEmptyString") },
    { key = "v", mods = "LEADER", action = act.PasteFrom("Clipboard") },
    { key = "V", mods = "LEADER|SHIFT", action = act.PasteFrom("PrimarySelection") },
    -- KeyTable
    { key = "c", mods = "LEADER", action = act.ActivateCopyMode },
    { key = "phys:Space", mods = "LEADER", action = act.QuickSelect },
    -- LEADER-'r': resize-pane mode until we cancel that mode.
    {
      key = "r",
      mods = "LEADER",
      action = act.ActivateKeyTable({
        name = "resize_pane",
        one_shot = false,
      }),
    },
    -- LEADER-'w': activate-pane mode until we press some other key or until timeout (1000ms)
    {
      key = "w",
      mods = "LEADER",
      action = act.ActivateKeyTable({
        name = "activate_pane",
        timeout_milliseconds = 1000,
      }),
    },
  }
  config.key_tables = {
    -- Defines the keys that are active in our resize-pane mode.
    -- Since we're likely to want to make multiple adjustments,
    -- we made the activation one_shot=false. We therefore need
    -- to define a key assignment for getting out of this mode.
    -- 'resize_pane' here corresponds to the name="resize_pane" in
    -- the key assignments above.
    resize_pane = {
      { key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 1 }) },
      { key = "h", action = act.AdjustPaneSize({ "Left", 1 }) },

      { key = "RightArrow", action = act.AdjustPaneSize({ "Right", 1 }) },
      { key = "l", action = act.AdjustPaneSize({ "Right", 1 }) },

      { key = "UpArrow", action = act.AdjustPaneSize({ "Up", 1 }) },
      { key = "k", action = act.AdjustPaneSize({ "Up", 1 }) },

      { key = "DownArrow", action = act.AdjustPaneSize({ "Down", 1 }) },
      { key = "j", action = act.AdjustPaneSize({ "Down", 1 }) },

      -- Cancel the mode by pressing escape
      { key = "Escape", action = "PopKeyTable" },
    },

    -- Defines the keys that are active in our activate-pane mode.
    -- 'activate_pane' here corresponds to the name="activate_pane" in
    -- the key assignments above.
    activate_pane = {
      { key = "LeftArrow", action = act.ActivatePaneDirection("Left") },
      { key = "h", action = act.ActivatePaneDirection("Left") },

      { key = "RightArrow", action = act.ActivatePaneDirection("Right") },
      { key = "l", action = act.ActivatePaneDirection("Right") },

      { key = "UpArrow", action = act.ActivatePaneDirection("Up") },
      { key = "k", action = act.ActivatePaneDirection("Up") },

      { key = "DownArrow", action = act.ActivatePaneDirection("Down") },
      { key = "j", action = act.ActivatePaneDirection("Down") },
    },
  }
end

return M

To Reproduce

No response

Configuration

https://github.com/ensonmj/dotfiles/tree/master/wezterm/.config/wezterm

Expected Behavior

copy and paste should work like local

Logs

No response

Anything else?

No response

wez commented 1 year ago

Please run through https://wezfurlong.org/wezterm/troubleshooting.html#debugging-keyboard-related-issues to capture some debugging around your leader-v key press so we can see what it is trying to do

majian4work commented 1 year ago

Set debug_key_events and delete all old logs in ~/.local/share/wezterm Open new wezterm on windows and run wezterm connect xxx, then try to copy and paste.

13:08:53.089  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(W), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(W), raw_code: 87, scan_code: 17, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:53.090  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('w'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(W), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(W), raw_code: 87, scan_code: 17, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('w') } 
13:08:53.090  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[87;17;119;0;0;1_"
13:08:53.155  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:53.155  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:53.156  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;0;0;1_"
13:08:53.827  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Backspace), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Backspace), raw_code: 8, scan_code: 14, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:53.827  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('\u{8}'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Backspace), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Backspace), raw_code: 8, scan_code: 14, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('\u{8}') } 
13:08:53.827  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[8;14;8;0;0;1_"
13:08:54.005  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Backspace), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Backspace), raw_code: 8, scan_code: 14, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:54.005  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('\u{8}'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Backspace), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Backspace), raw_code: 8, scan_code: 14, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('\u{8}') } 
13:08:54.005  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[8;14;8;0;0;1_"
13:08:54.174  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(LeftShift), modifiers: SHIFT | LEFT_SHIFT, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 16, scan_code: 42, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:54.174  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: LeftShift, modifiers: SHIFT | LEFT_SHIFT, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(LeftShift), modifiers: SHIFT | LEFT_SHIFT, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 16, scan_code: 42, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('\0') } 
13:08:54.174  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[16;42;0;1;16;1_"
13:08:54.335  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(LeftShift), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 16, scan_code: 42, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:54.335  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: LeftShift, modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(LeftShift), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 16, scan_code: 42, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('\0') } 
13:08:54.335  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[16;42;0;0;0;1_"
13:08:54.497  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(W), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(W), raw_code: 87, scan_code: 17, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:54.497  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('w'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(W), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(W), raw_code: 87, scan_code: 17, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('w') } 
13:08:54.497  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[87;17;119;1;0;1_"
13:08:54.871  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:54.871  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:54.871  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;1;0;1_"
13:08:54.873  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(W), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(W), raw_code: 87, scan_code: 17, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:54.873  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('w'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(W), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(W), raw_code: 87, scan_code: 17, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('w') } 
13:08:54.873  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[87;17;119;0;0;1_"
13:08:54.875  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:54.875  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:54.875  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;0;0;1_"
13:08:56.383  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Z), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Z), raw_code: 90, scan_code: 44, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:56.384  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('z'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(Z), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Z), raw_code: 90, scan_code: 44, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('z') } 
13:08:56.384  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[90;44;122;1;0;1_"
13:08:56.538  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Z), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Z), raw_code: 90, scan_code: 44, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:56.538  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('z'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Z), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Z), raw_code: 90, scan_code: 44, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('z') } 
13:08:56.538  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[90;44;122;0;0;1_"
13:08:56.824  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:56.824  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('t'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('t') } 
13:08:56.824  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[84;20;116;1;0;1_"
13:08:56.973  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:56.973  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('t'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('t') } 
13:08:56.973  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[84;20;116;0;0;1_"
13:08:57.172  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:57.172  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:57.172  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;1;0;1_"
13:08:57.270  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(R), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(R), raw_code: 82, scan_code: 19, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:57.270  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('r'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(R), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(R), raw_code: 82, scan_code: 19, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('r') } 
13:08:57.270  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[82;19;114;1;0;1_"
13:08:57.375  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:57.375  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:57.375  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;0;0;1_"
13:08:57.391  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:57.391  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('m'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('m') } 
13:08:57.391  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[77;50;109;1;0;1_"
13:08:57.403  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(R), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(R), raw_code: 82, scan_code: 19, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:57.403  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('r'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(R), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(R), raw_code: 82, scan_code: 19, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('r') } 
13:08:57.403  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[82;19;114;0;0;1_"
13:08:57.518  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:57.518  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('m'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('m') } 
13:08:57.518  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[77;50;109;0;0;1_"
13:08:58.037  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:58.037  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char(' '), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some(' ') } 
13:08:58.037  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[32;57;32;1;0;1_"
13:08:58.172  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:58.172  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char(' '), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some(' ') } 
13:08:58.172  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[32;57;32;0;0;1_"
13:08:58.913  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:58.913  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('c'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('c') } 
13:08:58.913  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[67;46;99;1;0;1_"
13:08:59.044  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:59.044  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('c'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('c') } 
13:08:59.044  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[67;46;99;0;0;1_"
13:08:59.047  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(O), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(O), raw_code: 79, scan_code: 24, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:59.047  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('o'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(O), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(O), raw_code: 79, scan_code: 24, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('o') } 
13:08:59.047  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[79;24;111;1;0;1_"
13:08:59.145  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(O), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(O), raw_code: 79, scan_code: 24, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:59.145  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('o'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(O), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(O), raw_code: 79, scan_code: 24, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('o') } 
13:08:59.145  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[79;24;111;0;0;1_"
13:08:59.240  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:59.240  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('n'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('n') } 
13:08:59.240  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[78;49;110;1;0;1_"
13:08:59.345  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:59.345  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('n'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('n') } 
13:08:59.345  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[78;49;110;0;0;1_"
13:08:59.426  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:59.426  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('n'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('n') } 
13:08:59.426  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[78;49;110;1;0;1_"
13:08:59.534  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:59.534  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('n'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(N), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(N), raw_code: 78, scan_code: 49, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('n') } 
13:08:59.534  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[78;49;110;0;0;1_"
13:08:59.644  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:59.644  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:59.644  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;1;0;1_"
13:08:59.745  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:08:59.745  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('e'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(E), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(E), raw_code: 69, scan_code: 18, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('e') } 
13:08:59.745  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[69;18;101;0;0;1_"
13:08:59.920  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:08:59.920  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('c'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('c') } 
13:08:59.920  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[67;46;99;1;0;1_"
13:09:00.043  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:00.043  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('c'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('c') } 
13:09:00.044  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[67;46;99;0;0;1_"
13:09:00.191  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:00.191  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('t'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('t') } 
13:09:00.191  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[84;20;116;1;0;1_"
13:09:00.322  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:00.322  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('t'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(T), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(T), raw_code: 84, scan_code: 20, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('t') } 
13:09:00.322  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[84;20;116;0;0;1_"
13:09:00.325  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:00.325  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char(' '), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some(' ') } 
13:09:00.325  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[32;57;32;1;0;1_"
13:09:00.405  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:00.416  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char(' '), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Space), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Space), raw_code: 32, scan_code: 57, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some(' ') } 
13:09:00.417  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[32;57;32;0;0;1_"
13:09:00.689  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:00.689  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('m'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('m') } 
13:09:00.689  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[77;50;109;1;0;1_"
13:09:00.791  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:00.791  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('m'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(M), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(M), raw_code: 77, scan_code: 50, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('m') } 
13:09:00.791  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[77;50;109;0;0;1_"
13:09:00.927  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(J), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(J), raw_code: 74, scan_code: 36, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:00.927  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('j'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(J), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(J), raw_code: 74, scan_code: 36, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('j') } 
13:09:00.927  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[74;36;106;1;0;1_"
13:09:01.056  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(J), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(J), raw_code: 74, scan_code: 36, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:01.056  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('j'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(J), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(J), raw_code: 74, scan_code: 36, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('j') } 
13:09:01.056  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[74;36;106;0;0;1_"
13:09:01.253  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Period), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Period), raw_code: 190, scan_code: 52, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:01.253  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('.'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(Period), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Period), raw_code: 190, scan_code: 52, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('.') } 
13:09:01.253  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[190;52;46;1;0;1_"
13:09:01.372  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Period), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Period), raw_code: 190, scan_code: 52, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:01.372  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('.'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Period), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Period), raw_code: 190, scan_code: 52, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('.') } 
13:09:01.372  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[190;52;46;0;0;1_"
13:09:01.765  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(I), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(I), raw_code: 73, scan_code: 23, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:01.778  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('i'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(I), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(I), raw_code: 73, scan_code: 23, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('i') } 
13:09:01.778  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[73;23;105;1;0;1_"
13:09:01.849  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(I), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(I), raw_code: 73, scan_code: 23, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:01.849  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('i'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(I), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(I), raw_code: 73, scan_code: 23, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('i') } 
13:09:01.849  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[73;23;105;0;0;1_"
13:09:02.059  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:02.059  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('c'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('c') } 
13:09:02.059  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[67;46;99;1;0;1_"
13:09:02.176  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:02.177  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('c'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(C), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(C), raw_code: 67, scan_code: 46, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('c') } 
13:09:02.177  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[67;46;99;0;0;1_"
13:09:02.297  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(X), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(X), raw_code: 88, scan_code: 45, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:02.297  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('x'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(X), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(X), raw_code: 88, scan_code: 45, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('x') } 
13:09:02.297  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[88;45;120;1;0;1_"
13:09:02.429  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(X), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(X), raw_code: 88, scan_code: 45, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:02.429  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('x'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(X), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(X), raw_code: 88, scan_code: 45, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('x') } 
13:09:02.429  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[88;45;120;0;0;1_"
13:09:02.750  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Return), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Return), raw_code: 13, scan_code: 28, repeat_count: 1, key_is_down: true, handled: Handled(false) } 
13:09:02.750  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('\r'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(Return), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Return), raw_code: 13, scan_code: 28, repeat_count: 1, key_is_down: true, handled: Handled(false) }), win32_uni_char: Some('\r') } 
13:09:02.750  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[13;28;13;1;0;1_"
13:09:02.857  INFO   wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(Return), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Return), raw_code: 13, scan_code: 28, repeat_count: 1, key_is_down: false, handled: Handled(false) } 
13:09:02.857  INFO   wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('\r'), modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(Return), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(Return), raw_code: 13, scan_code: 28, repeat_count: 1, key_is_down: false, handled: Handled(false) }), win32_uni_char: Some('\r') } 
13:09:02.857  INFO   wezterm_gui::termwindow::keyevent > win32: Encoded input as "\u{1b}[13;28;13;0;0;1_"
wez commented 1 year ago

I'd like to see the debug_key_events output from the wezterm connect process. eg: run this from a terminal:

wezterm.exe --config "debug_key_events=true" connect xxx

and share its output

majian4work commented 1 year ago

Okay, I will update it as soon as I have some free time.

majian4work commented 1 year ago
➜ wezterm --config "debug_key_events=true" connect xxx                                                    
10:31:53.845  INFO   mux > detaching domain
10:31:53.846  INFO   wezterm_client::domain > detached domain 9
10:31:53.846  INFO   mux                    > domain detached panes: [3, 1, 2, 4]

Seems no key event log output from terminal wezterm?

xieve commented 5 months ago

I believe I might be seeing the same issue. I'm running wezterm 20240203-110809-5046fc22 inside WSLg (NixOS) directly/without using the remote multiplexing feature. Copy works, paste does not.

Select text ‣ Ctrl+Shift+C ‣ Paste into Windows application works. Select text ‣ Ctrl+Shift+CCtrl+Shift+V does not work. Copy text from Windows application ‣ Ctrl+Shift+V does not work.

$ wsl.exe --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.4412
Log I copied something to the clipboard from Windows, then started Wezterm and pressed Ctrl+Shift+V. ```shell $ wezterm --skip-config --config "debug_key_events=true" MESA: error: ZINK: failed to choose pdev libEGL warning: egl: failed to create dri2 screen 16:22:08.574 INFO wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(LeftControl), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(LeftControl), raw_code: 37, repeat_count: 1, key_is_down: true, handled: Handled(false) } 16:22:08.574 INFO wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: LeftControl, modifiers: NONE, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(LeftControl), modifiers: NONE, leds: NUM_LOCK, phys_code: Some(LeftControl), raw_code: 37, repeat_count: 1, key_is_down: true, handled: Handled(false) }) } 16:22:08.574 INFO wezterm_gui::termwindow::keyevent > send to pane DOWN key=LeftControl mods=NONE 16:22:08.702 INFO wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(LeftShift), modifiers: CTRL, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 50, repeat_count: 1, key_is_down: true, handled: Handled(false) } 16:22:08.702 INFO wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: LeftShift, modifiers: CTRL, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(LeftShift), modifiers: CTRL, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 50, repeat_count: 1, key_is_down: true, handled: Handled(false) }) } 16:22:08.702 INFO wezterm_gui::termwindow::keyevent > send to pane DOWN key=LeftShift mods=CTRL 16:22:08.941 INFO wezterm_gui::termwindow::keyevent > key_event RawKeyEvent { key: Physical(V), modifiers: SHIFT | CTRL, leds: NUM_LOCK, phys_code: Some(V), raw_code: 55, repeat_count: 1, key_is_down: true, handled: Handled(false) } 16:22:08.941 INFO wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('V'), modifiers: CTRL, leds: NUM_LOCK, repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Physical(V), modifiers: SHIFT | CTRL, leds: NUM_LOCK, phys_code: Some(V), raw_code: 55, repeat_count: 1, key_is_down: true, handled: Handled(false) }) } 16:22:08.941 INFO wezterm_gui::termwindow::keyevent > Char('V') CTRL -> perform PasteFrom(Clipboard) 16:22:09.035 INFO wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: Char('V'), modifiers: CTRL, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(V), modifiers: SHIFT | CTRL, leds: NUM_LOCK, phys_code: Some(V), raw_code: 55, repeat_count: 1, key_is_down: false, handled: Handled(false) }) } 16:22:09.035 INFO wezterm_gui::termwindow::keyevent > send to pane UP key=Char('V') mods=CTRL 16:22:09.162 INFO wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: LeftShift, modifiers: SHIFT | CTRL, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(LeftShift), modifiers: SHIFT | CTRL, leds: NUM_LOCK, phys_code: Some(LeftShift), raw_code: 50, repeat_count: 1, key_is_down: false, handled: Handled(false) }) } 16:22:09.162 INFO wezterm_gui::termwindow::keyevent > send to pane UP key=LeftShift mods=SHIFT | CTRL 16:22:09.171 INFO wezterm_gui::termwindow::keyevent > key_event KeyEvent { key: LeftControl, modifiers: CTRL, leds: NUM_LOCK, repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Physical(LeftControl), modifiers: CTRL, leds: NUM_LOCK, phys_code: Some(LeftControl), raw_code: 37, repeat_count: 1, key_is_down: false, handled: Handled(false) }) } 16:22:09.171 INFO wezterm_gui::termwindow::keyevent > send to pane UP key=LeftControl mods=CTRL 16:22:12.245 WARN window::os::wayland::connection > Enter { serial: 2561, surface: wl_surface@34, keys: [] }, no known surface warning: queue 0x55f708592e50 destroyed while proxies still attached: wl_buffer@53 still attached wl_buffer@52 still attached wl_buffer@57 still attached wl_buffer@48 still attached wl_buffer@47 still attached wl_callback@46 still attached wl_data_offer@4278190083 still attached wl_data_offer@4278190082 still attached wl_buffer@20 still attached wl_shm_pool@23 still attached wl_buffer@45 still attached wl_buffer@44 still attached wl_buffer@51 still attached wl_buffer@50 still attached wl_buffer@49 still attached wl_data_offer@4278190080 still attached wl_subsurface@43 still attached wl_surface@42 still attached wl_subsurface@41 still attached wl_surface@40 still attached wl_subsurface@39 still attached wl_surface@38 still attached wl_subsurface@37 still attached wl_surface@36 still attached wl_subsurface@35 still attached wl_surface@34 still attached xdg_wm_base@17 still attached wl_surface@16 still attached wl_data_device@14 still attached wl_pointer@12 still attached wl_keyboard@3 still attached wl_data_device@11 still attached wl_output@10 still attached wl_seat@9 still attached wl_output@8 still attached wl_shm@7 still attached wl_data_device_manager@6 still attached wl_subcompositor@5 still attached wl_compositor@4 still attached wl_registry@2 still attached ```

Possibly related: https://github.com/microsoft/wslg/issues/649 https://github.com/microsoft/wslg/issues/15

I devised the following workaround using wl-clipboard:

local wezterm = require "wezterm"
local config = wezterm.config_builder()

if os.getenv("WSL_DISTRO_NAME") ~= nil then
  config.keys = {
    {
      key = "v",
      mods = "CTRL|SHIFT",
      action = wezterm.action.EmitEvent("wsl-paste-workaround"),
    },
  }
  wezterm.on("wsl-paste-workaround", function(window, pane)
    local success, stdout, stderr = wezterm.run_child_process({"wl-paste", "--no-newline"})
    if success then
      pane:paste(stdout)
    else
      wezterm.log_error("wl-paste failed with\n" .. stderr .. stdout)
    end
  end)
end