GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Copying text causes the WSL GUI program window to disappear. · Issue #66978 · anomalyco/opencode

Copying text causes the WSL GUI program window to disappear. #66978

New issue
Copy link
New issue
Copy link
Backlog
Backlog
Copying text causes the WSL GUI program window to disappear.#66978
Copy link
Labels
area/tuiTerminal interfaceplatform/windowsWindowsplatform/wslWindows Subsystem for Linuxtype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@codemao852
codemao852
opened on Nov 28, 2026
Issue body actions

Description

When using the latest version of opencode 2.x in WSL, after selected text is automatically copied, GUI programs opened in WSL may have their windows disappear (currently using Android Studio), and you must end the process and restart it to recover. Setting it to manual copy still has the same problem, but using opencode 1.x does not have this issue.

Plugins

No response

OpenCode version

2.4.2

Steps to reproduce

No response

Screenshot

No response

Operating System

Windows 11

Terminal

PowerShell 7.7

Activity

  1. opencodejr
    added
    area/tuiTerminal interface
    platform/windowsWindows
    platform/wslWindows Subsystem for Linux
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 28, 2026
  2. opencodejr commented on Nov 28, 2026

    @opencodejr
    opencodejrBot
    on Nov 28, 2026
    Contributor
    More actions

    Thanks for the report. Reproducing this needs Windows 11 with WSL2 and WSLg running a Linux GUI app, and we can't set that up in our automated environment, so a maintainer with a WSL setup will need to look at it.

    In the meantime, these details would help:

    • Which clipboard tools are installed in your WSL distro, if any (wl-copy, xclip, xsel), and the output of echo $WAYLAND_DISPLAY $DISPLAY.
    • Whether it also happens on an earlier 2.x release, for example 2.3.2. That would tell us whether it started with 2.4.x.
    • Whether other WSLg apps (e.g. gedit or xeyes) lose their windows too, or only Android Studio.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done editing.

    Related: #65913 (on v2.4.1 in WSL2, selected text shows "Copied to clipboard" but can't be pasted).

  3. fanyzp commented on Nov 28, 2026

    @fanyzp
    fanyzp
    on Nov 28, 2026
    More actions

    hey, thanks for the report. i looked into this and your report is plausible, though i couldn't reproduce the disappearing window itself, no wsl gui setup here to test against.

    what i verified: in 2.x every copy writes to the native host clipboard through opentui on top of osc 52. that host write talks to the wslg compositor, whose clipboard is shared with every gui app on the desktop. wslg's weston has a documented problem with background clipboard access stealing keyboard focus (microsoft/wslg#1512), and the same host write is already known to report success without ever reaching the windows clipboard (#65913). osc 52 alone can't hide another app's window, so the host write is the only opencode action that could be doing this, which also fits 1.x being fine.

    i put up a fix that skips the host clipboard write on wsl and copies through the terminal (osc 52) only, so copying no longer touches the compositor at all. the branch is pushed but i couldn't open the pr from here, so the diff is at dev...fanyzp:fix-wsl-clipboard

    two things that would settle whether this is opencode or wslg: does the android studio window come back with alt+tab, or is it gone until you kill the process? and does /mnt/wslg/weston.log show anything from right after it happens? if the window is gone for good and weston logged a crash, that's a wslg bug opencode can only avoid triggering, which is what the fix does.

  4. codemao852 commented on Nov 28, 2026

    @codemao852
    codemao852
    on Nov 28, 2026
    Author
    More actions

    I found microsoft/weston-mirror#175 merge request in the Microsoft Weston repository. After I merged it and rebuilt WSLg and tested it, the issue still persists. However, when I switched back to opencode 1.x, the problem disappeared. I also tested mimocode, which is developed based on opencode 1.x, and there was still no problem. Regarding what you mentioned about switching windows with Alt+Tab, I tested that too, and it had no effect. At this point, it can basically be confirmed that this is a problem with opencode 2.x. WSL is the latest version 3.0.5. It doesn't cause the GUI window to disappear every time, but it happens quite frequently, so I have no choice but to roll back to opencode 1.x. I hope this can be fixed as soon as possible. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tuiTerminal interfaceplatform/windowsWindowsplatform/wslWindows Subsystem for Linuxtype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.