Terminal starts typing random characters automatically during opencode OAuth setup #6475

Open
opened 2026-02-16 18:04:20 -05:00 by yindo · 1 comment
Owner

Originally created by @isurudinusha on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

While setting up opencode and completing the OAuth flow, the terminal begins outputting random characters automatically without any user input. This happens immediately after the OAuth URL is displayed and the process appears to lose control of stdin.

The behavior makes the CLI unusable and forces the user to terminate the process manually.

Expected Behavior
The CLI should wait for user input or proceed normally after OAuth without injecting any characters into the terminal.

Actual Behavior
The terminal starts typing long sequences of random characters automatically, including numbers, semicolons, and escape-like sequences. No keyboard input is being made by the user.

Environment

OS: Windows 10

Terminal: Git Bash (MINGW64)

Shell: bash

Node.js: v22.18.0

opencode version: latest at time of testing

Additional Notes

The issue looks related to stdin handling after OAuth redirect.

Possibly caused by improper terminal mode reset or accidental stream piping.

Happens consistently after OAuth URL generation.

Screenshot attached showing the random character output.

Impact
Blocks initial setup and prevents further use of the CLI.

Plugins

CLI

OpenCode version

1.1.23

Steps to reproduce

Run opencode in a terminal (Git Bash MINGW64 on Windows).

Run opencode auth login.

Proceed with the OAuth setup.

After the OAuth URL is printed, observe the terminal.

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Git

Originally created by @isurudinusha on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description While setting up opencode and completing the OAuth flow, the terminal begins outputting random characters automatically without any user input. This happens immediately after the OAuth URL is displayed and the process appears to lose control of stdin. The behavior makes the CLI unusable and forces the user to terminate the process manually. Expected Behavior The CLI should wait for user input or proceed normally after OAuth without injecting any characters into the terminal. Actual Behavior The terminal starts typing long sequences of random characters automatically, including numbers, semicolons, and escape-like sequences. No keyboard input is being made by the user. Environment OS: Windows 10 Terminal: Git Bash (MINGW64) Shell: bash Node.js: v22.18.0 opencode version: latest at time of testing Additional Notes The issue looks related to stdin handling after OAuth redirect. Possibly caused by improper terminal mode reset or accidental stream piping. Happens consistently after OAuth URL generation. Screenshot attached showing the random character output. Impact Blocks initial setup and prevents further use of the CLI. ### Plugins CLI ### OpenCode version 1.1.23 ### Steps to reproduce Run opencode in a terminal (Git Bash MINGW64 on Windows). Run opencode auth login. Proceed with the OAuth setup. After the OAuth URL is printed, observe the terminal. ### Screenshot and/or share link <img width="1304" height="433" alt="Image" src="https://github.com/user-attachments/assets/0746c992-f6d2-4111-a824-1f6b5a6dec8d" /> ### Operating System Windows 11 ### Terminal Git
yindo added the windowsopentuibug labels 2026-02-16 18:04:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

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

  • #8715: Opencode Windows Character Spamming - Similar issue where random character sequences are output to terminal after exiting on Windows/wezterm
  • #8866: on linux server (eg: arch linux server, not desktop), opencode will auto type string(eg: ;23M;26M;29M) into input area when it doing task - Similar issue with escape sequences being auto-typed on Linux servers
  • #5936: Random Artifactts In Terminal After Running - Related issue with random artifacts appearing in terminal on Windows after exiting, possibly tied to mouse movement/stdin handling

All these issues appear to be related to improper terminal mode reset or stdin handling across different platforms (Windows, Linux) and terminal emulators (wezterm, Git Bash). Your issue specifically mentions the problem occurs during OAuth setup before exit, while the other issues occur after exit, but they may share a common root cause in terminal state management.

Feel free to ignore if your case involves specific OAuth-related behavior not covered by these issues.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of existing issues. Please check: - #8715: Opencode Windows Character Spamming - Similar issue where random character sequences are output to terminal after exiting on Windows/wezterm - #8866: on linux server (eg: arch linux server, not desktop), opencode will auto type string(eg: ;23M;26M;29M) into input area when it doing task - Similar issue with escape sequences being auto-typed on Linux servers - #5936: Random Artifactts In Terminal After Running - Related issue with random artifacts appearing in terminal on Windows after exiting, possibly tied to mouse movement/stdin handling All these issues appear to be related to improper terminal mode reset or stdin handling across different platforms (Windows, Linux) and terminal emulators (wezterm, Git Bash). Your issue specifically mentions the problem occurs during OAuth setup before exit, while the other issues occur after exit, but they may share a common root cause in terminal state management. Feel free to ignore if your case involves specific OAuth-related behavior not covered by these issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6475