Skip to content

Copy & Newline Not Working in macOS Default Terminal #12003

Closed

Description

@Rishabh250

Description

When running OpenCode in macOS Default Terminal.app, I’m unable to:

  • Copy selected text
  • Insert a new line while typing prompts

This makes OpenCode nearly unusable in interactive mode.

Environment

  • OS: macOS (Sonoma / Ventura – reproducible on default Terminal.app)
  • Terminal: macOS Terminal.app (default)
  • Shell: zsh
  • OpenCode Version: latest
  • Node Version: node -v
  • Installation: CLI (opencode)

Steps to Reproduce

  1. Open Terminal.app
  2. Run opencode
  3. Try selecting text and copying (Cmd + C or right-click)
  4. Try inserting a new line while typing a prompt (Enter / Cmd+Enter)

Expected Behavior

  • Text selection should be copyable using Cmd + C
  • Enter should create a new line in the editor (or documented keybinding)

Actual Behavior

  • Copy does not work
  • Enter submits instead of inserting a new line
  • No way to insert multi-line prompts in Terminal.app

Additional Notes

  • This appears to be a terminal input handling issue

  • Likely related to:

    • raw mode / TTY handling
    • readline / ink / blessed-style input
  • Works better (or differently) in iTerm2 (needs confirmation)

Impact
High — makes OpenCode difficult to use on macOS without switching terminals.

Plugins

No response

OpenCode version

latest

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

No response

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 3, 2026
  2. github-actions commented on Feb 3, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. kommander commented on Feb 3, 2026

    @kommander
    Contributor

    Enter is meant to submit the prompt, shift+enter usually does newline. Terminal.app does not support shift+enter detection though. Option+enter might work. Selected text is automatically copied, there is no shortcut for it, unless you use native terminal selection.

    Opencode has nothing to do with node, it uses Bun.

  4. justfortheloveof commented on Feb 3, 2026

    @justfortheloveof
    Contributor

    For what it's worth, if for whatever reason copy on select isn't working in OpenCode, try holding shift while you select text.
    (Most terminals support this, holding shift will make it so you have "normal" terminal selection instead of it being controlled by the TUI)

  5. nmarley commented on Feb 3, 2026

    @nmarley

    The "Copy to Clipboard" functionality isn't working on Ghostty either. This just started with the latest version. It says "Copied to clipboard" toward the top-right, but nothing gets copied to the clipboard.

  6. nmarley commented on Feb 4, 2026

    @nmarley

    Clipboard issue seems to be fixed in 1.1.51, using Ghostty + tmux w/macOS 26.

  7. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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 opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions