opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Fix keybind documentation: use return instead of enter

Open StevenTCramer opened this issue 1 month ago • 4 comments

Fix keybind documentation: use return instead of enter

The keybind parser doesn't normalize enter to return, but the terminal sends key events as return. This causes keybinds using enter (like input_submit: "enter" and input_newline: "shift+enter") to silently fail.

Updated all instances of enter to return to match what the terminal actually sends and what the code expects internally.

StevenTCramer avatar Dec 09 '25 14:12 StevenTCramer

Hello, I've already modified the return but the problem still persists. Why is that?

Ruagewei avatar Dec 09 '25 15:12 Ruagewei

@StevenTCramer newer versions should actually alias return/enter both ways.

kommander avatar Dec 09 '25 16:12 kommander

@StevenTCramer newer versions should actually alias return/enter both ways.

When I’m using the OpenCode extension in VS Code, neither the Return key nor the Enter key works. What’s causing this issue? I tried setting Shift + Enter to insert a new line, but it still doesn’t work — the only thing that works is Control + J.

Ruagewei avatar Dec 09 '25 16:12 Ruagewei

@Ruagewei the issue is that xterm.js that is used in vscode does not support alternate keys/modify other keys, neither CSI u nor kitty keyboard. There is no way to get modifiers for the enter/return key, so the terminal always just sends \r. The only way is to setup a custom key binding in the vscode config to send \n for shift+enter.

kommander avatar Dec 09 '25 17:12 kommander