[GH-ISSUE #740] Bug: useKeyboard hook not responding and createSignal updates not reflecting on Windows (MINGW64/Git Bash) #203

Open
opened 2026-03-02 23:45:14 +03:00 by kerem · 2 comments
Owner

Originally created by @cppsh1t on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/740


Issue Title

Bug: useKeyboard hook not responding and createSignal updates not reflecting on Windows (MINGW64/Git Bash)

Issue Body

Description

I copied a simple counter example from the official OpenTUI Solid documentation. The example uses useKeyboard to handle key presses (Up/Down arrows for counting, ESC to exit) and createSignal for state management. However, neither the keyboard events nor the signal updates are working on Windows when running with Bun in a Git Bash (MINGW64) terminal.

Reproduction Steps

  1. Create a new project using bun create tui
  2. Copy the following code into src/index.tsx (exactly as shown in the docs):
import { render, useKeyboard } from "@opentui/solid"
import { createSignal } from "solid-js"

const App = () => {
  const [count, setCount] = createSignal(0)

  useKeyboard((key) => {
    if (key.name === "up") setCount((c) => c + 1)
    if (key.name === "down") setCount((c) => c - 1)
    if (key.name === "escape") process.exit(0)
  })

  return (
    <box border padding={2}>
      <text>Count: {count()}</text>
      <text fg="#888">Up/Down to change, ESC to exit</text>
    </box>
  )
}

render(App)
  1. Run with bun run dev
  2. Try pressing Up/Down arrow keys or ESC

Expected Behavior

  • Pressing Up arrow should increment the counter (display updates)
  • Pressing Down arrow should decrement the counter (display updates)
  • Pressing ESC should exit the application

Actual Behavior

  • The counter remains at 0 and does not update
  • The keyboard event handler inside useKeyboard callback is never called (verified by adding console.log)
  • ESC does not exit the application
  • The UI renders correctly but is completely unresponsive to keyboard input

Environment

OS and Terminal:

  • OS: Windows 10 (Build 19045)
  • Shell: MINGW64_NT-10.0-19045 (Git Bash for Windows)
  • Terminal: Git Bash terminal

Runtime and Package Versions:

  • Node.js: v22.19.0
  • Bun: 1.3.6
  • TypeScript: ^5
  • @opentui/core: 0.1.81
  • @opentui/solid: 0.1.81
  • solid-js: 1.9.9
Image
Originally created by @cppsh1t on GitHub (Feb 25, 2026). Original GitHub issue: https://github.com/anomalyco/opentui/issues/740 --- ## Issue Title **Bug: `useKeyboard` hook not responding and `createSignal` updates not reflecting on Windows (MINGW64/Git Bash)** ## Issue Body ### Description I copied a simple counter example from the official OpenTUI Solid documentation. The example uses `useKeyboard` to handle key presses (Up/Down arrows for counting, ESC to exit) and `createSignal` for state management. However, neither the keyboard events nor the signal updates are working on Windows when running with Bun in a Git Bash (MINGW64) terminal. ### Reproduction Steps 1. Create a new project using `bun create tui` 2. Copy the following code into `src/index.tsx` (exactly as shown in the docs): ```tsx import { render, useKeyboard } from "@opentui/solid" import { createSignal } from "solid-js" const App = () => { const [count, setCount] = createSignal(0) useKeyboard((key) => { if (key.name === "up") setCount((c) => c + 1) if (key.name === "down") setCount((c) => c - 1) if (key.name === "escape") process.exit(0) }) return ( <box border padding={2}> <text>Count: {count()}</text> <text fg="#888">Up/Down to change, ESC to exit</text> </box> ) } render(App) ``` 3. Run with `bun run dev` 4. Try pressing Up/Down arrow keys or ESC ### Expected Behavior - Pressing Up arrow should increment the counter (display updates) - Pressing Down arrow should decrement the counter (display updates) - Pressing ESC should exit the application ### Actual Behavior - The counter remains at 0 and does not update - The keyboard event handler inside `useKeyboard` callback is never called (verified by adding console.log) - ESC does not exit the application - The UI renders correctly but is completely unresponsive to keyboard input ### Environment **OS and Terminal:** - OS: Windows 10 (Build 19045) - Shell: MINGW64_NT-10.0-19045 (Git Bash for Windows) - Terminal: Git Bash terminal **Runtime and Package Versions:** - Node.js: v22.19.0 - Bun: 1.3.6 - TypeScript: ^5 - `@opentui/core`: 0.1.81 - `@opentui/solid`: 0.1.81 - `solid-js`: 1.9.9 <img width="1173" height="648" alt="Image" src="https://github.com/user-attachments/assets/eda8f2df-cfee-4444-af7b-c32cd900dd94" />
Author
Owner

@cppsh1t commented on GitHub (Feb 25, 2026):

I first discovered the useKeyboard issue while testing logs in another project that uses opentui. Later I switched to using useRenderer().keyInput.on("keypress", callback) directly and that successfully triggered events. I then discovered that signals were also not working properly, so I finally copied the simplest counter example to test and found it still doesn't work.

<!-- gh-comment-id:3958132355 --> @cppsh1t commented on GitHub (Feb 25, 2026): I first discovered the `useKeyboard` issue while testing logs in another project that uses opentui. Later I switched to using `useRenderer().keyInput.on("keypress", callback)` directly and that successfully triggered events. I then discovered that signals were also not working properly, so I finally copied the simplest counter example to test and found it still doesn't work.
Author
Owner

@cppsh1t commented on GitHub (Feb 25, 2026):

issue repository: https://github.com/cppsh1t/test-opentui-signal

<!-- gh-comment-id:3958160980 --> @cppsh1t commented on GitHub (Feb 25, 2026): issue repository: https://github.com/cppsh1t/test-opentui-signal
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#203
No description provided.