Skip to content

MacOS WithoutRenderer not reacting on keypresses without Enter #1518

@robin-samuel

Description

@robin-samuel

Describe the bug
The terminal doesn't react on input events directly on Mac if we use the option WithoutRenderer like on windows. It shows input sequences and they have to be submitted with enter. Windows instead directly processes them.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS macOS 26.0.1 (25A362)
  • Shell zsh
  • Terminal Emulator Mac Terminal, iTerm, Ghostty

To Reproduce
Steps to reproduce the behavior:

  1. Run the example program
  2. Press up or down key
  3. As you see didn't react
  4. Press enter
  5. Now it reacted

Source Code

package main

import tea "github.com/charmbracelet/bubbletea"

func main() {
	p := tea.NewProgram(model(5), tea.WithoutRenderer())
	if _, err := p.Run(); err != nil {
		panic(err)
	}
}

type model int

func (m model) Init() tea.Cmd {
	return nil
}

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
	switch msg := msg.(type) {
	case tea.KeyMsg:
		switch msg.String() {
		case "ctrl+c", "q":
			return m, tea.Quit
		case "up":
			m++
			println(m)
		case "down":
			m--
			println(m)
		}
	}
	return m, nil
}

func (m model) View() string {
	return ""
}

Expected behavior
I expected it to behave like on Windows. If I press the up/down key it should directly take that input and not wait for an enter to submit the input. When I press up/down the counter should react instantly and no input sequences should appear on the screen.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions