Skip to content

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

@cppsh1t

Description

@cppsh1t

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions