Skip to content

Screen lag/freezing when typing text (WSL2, TMUX, Alacritty) #8484

Closed

Description

@matevszm

Description

Image

I have recently started using opencode and I think it's a great tool, but unfortunately, when writing prompts, I experience unpleasant freeze/lags for few seconds. I use opencode inside WSL 2 on Windows 11, using the alacritty terminal inside tmux, although I checked and tmux has nothing to do with it here, I use bash.

I did not observe anything like that during the work of agent itself.

The GIF shows an unpleasant lag that disturbs with writing longer prompts and is simply annoying. Has anyone experienced something similar or knows how to fix it?

Ubuntu 24.04.2 LTS
Opencode 1.1.20
alacritty 0.16.1 (42f49ee)
WSL version: 2.6.3.0
Linux kernel: 6.6.87.2-1

Steps to reproduce

Run alacritty terminal on windows with WSL2 (ubuntu) inside, run opencode and start type

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    perfIndicates a performance issue or need for optimization
    on Jan 14, 2026
  2. github-actions commented on Jan 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

    Feel free to ignore if your issue is specific to input/typing lag rather than general scrolling/rendering lag.

  3. xxzefgh commented on Jan 15, 2026

    @xxzefgh

    Same for me, WSL2, Wezterm/Windows Terminal. It also started happening sometime after 1.0 release. My freezes are actually 10 seconds or more, completely unusable. Works on a different machine with the same setup 🤷‍♂️

  4. pattonjh commented on Jan 16, 2026

    @pattonjh

    This is happening to me as of yesterday as well. It's immensely frustrating. It also applies to scrolling through the opencode window, not just typing. I am also using Ubuntu via WSL.

  5. Tylopilus commented on Jan 19, 2026

    @Tylopilus

    Can confirm. I have the same issue displayed in the video

  6. shahabsalehi commented on Jan 19, 2026

    @shahabsalehi

    I’ve run into this issue multiple times on WSL2. These are the fixes that consistently worked for me.

    1. Cleaning up the disk, making sure that there is free space available

    2. Ensure system time is correctly synced
      If your Windows system clock is out of sync (for example, 1 hour ahead due to DST or time sync issues), opencode can appear to freeze.
      Internally, opencode uses time-based waits (e.g. CLOCK_REALTIME). When the system clock jumps or is incorrect, these waits can behave incorrectly and cause the UI to stop.

    If none of the above worked, try to see the logs with strace:

    sudo apt install -y strace
    Run opencode until it freezes
    Open a new terminal

    Find the PID: pgrep -n opencode

    Attach strace: sudo strace -p -f -s 200

    If you see repeated futex(...) and sched_yield() calls (especially with FUTEX_CLOCK_REALTIME), it’s likely a time-sync or event-loop issue.

    If you see other problems I guess gpt could help.

  7. pschiel commented on Jan 20, 2026

    @pschiel
    Contributor

    These lags occur when you have systemd-timesyncd enabled.

    What happens is that WSL will adjust the time differently than Windows, and Hyper-V correcting time back into the past - which causes corrupt timestamps, freezes in the client, as Javascript timeouts will suddenly wait seconds.

    Try sudo systemctl disable systemd-timesyncd && sudo systemctl stop systemd-timesyncd

  8. caozhiyuan commented on Jan 21, 2026

    @caozhiyuan
    Contributor

    try disable animations and set env set OPENCODE_DISABLE_TERMINAL_TITLE=1 #8667 (comment) @matevszm

  9. IPPO181 commented on Jan 27, 2026

    @IPPO181

    These lags occur when you have systemd-timesyncd enabled.

    What happens is that WSL will adjust the time differently than Windows, and Hyper-V correcting time back into the past - which causes corrupt timestamps, freezes in the client, as Javascript timeouts will suddenly wait seconds.

    Try sudo systemctl disable systemd-timesyncd && sudo systemctl stop systemd-timesyncd

    Thank you, this fixed my issue.

  10. IshanArya commented on Mar 17, 2026

    @IshanArya

    These lags occur when you have systemd-timesyncd enabled.

    What happens is that WSL will adjust the time differently than Windows, and Hyper-V correcting time back into the past - which causes corrupt timestamps, freezes in the client, as Javascript timeouts will suddenly wait seconds.

    Try sudo systemctl disable systemd-timesyncd && sudo systemctl stop systemd-timesyncd

    Awesome, how did you figure this out?

  11. xxzefgh commented on Mar 18, 2026

    @xxzefgh

    Same for me, WSL2, Wezterm/Windows Terminal. It also started happening sometime after 1.0 release. My freezes are actually 10 seconds or more, completely unusable. Works on a different machine with the same setup 🤷‍♂️

    Update:
    the root cause in my case was that the Windows time service decided to stop working at some point and my clock had drifted 30 seconds into the future 🚀🚀🚀

    after failing to fix the broken, just installed NetTime.

    my clock is immaculate now.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiperfIndicates a performance issue or need for optimizationwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions