wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

WSL: Pasting creates ghost empty entries in Windows clipboard history

Open imurodl opened this issue 9 months ago • 0 comments

Summary

When pasting text inside WezTerm running WSL, ghost empty entries appear in the Windows clipboard history (Win+V). These entries appear above and below the actual clipboard content.

Environment

  • WezTerm: latest nightly
  • OS: Windows 11 (WSL2, Ubuntu)
  • WSLg: enabled

Steps to Reproduce

  1. Open WezTerm with WSL
  2. Copy some text from any Windows application (e.g., browser)
  3. Paste into WezTerm (Ctrl+Shift+V)
  4. Open Windows clipboard history (Win+V)
  5. Observe empty entries appearing before and after the actual copied text

Expected Behavior

Pasting into WezTerm should not modify or add entries to the Windows clipboard history.

Actual Behavior

Each paste operation creates 1-2 empty/whitespace entries in the clipboard history surrounding the original content.

Image Image Image

Notes

  • This does not happen when pasting in other terminals (e.g., Windows Terminal)
  • This does not happen when pasting between pure Windows applications
  • This only happens when pasting inside WezTerm with WSL
  • Disabling enable_osc52_clipboard does not fix the issue
  • The issue persists regardless of the shell (bash, zsh) or application running inside the terminal

WezTerm Config

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

config.color_scheme = 'Ubuntu'
config.window_decorations = 'RESIZE'
config.font = wezterm.font('Fira Code', { weight = 'Regular' })
config.font_size = 11
config.default_prog = { 'wsl.exe', '~' }
config.wsl_domains = {
  {
    name = 'WSL:Ubuntu',
    distribution = 'Ubuntu',
    default_cwd = '~',
  },
}

return config

imurodl avatar Feb 23 '26 05:02 imurodl