Override Default Keymaps #12

Closed
opened 2026-02-16 17:24:50 -05:00 by yindo · 9 comments
Owner

Originally created by @JonathanRiche on GitHub (May 15, 2025).

It would be great if we could override some of the default keymaps ie for Tmux users i have CTRL + HJKL for moving between panes and those are default keybinds in opencode.

Originally created by @JonathanRiche on GitHub (May 15, 2025). It would be great if we could override some of the default keymaps ie for Tmux users i have CTRL + HJKL for moving between panes and those are default keybinds in opencode.
yindo closed this issue 2026-02-16 17:24:50 -05:00
Author
Owner

@net commented on GitHub (May 15, 2025):

Similarly none of the readline keybindings should default to anything other than their standard behavior:

  • ctrl+f should move forward one character, not open a file picker
  • ctrl-e should jump to the end of the line, not open $EDITOR
  • ctrl-u should delete from the cursor to the beginning of the line
  • ctrl-k should delete from the cursor to the end of the line, not open the command pallet
  • ctrl-n should move down one line

I'm sure there's more but these are just the few that made using the input unusable for me.

I know not everyone knows every single readline keybinding, but many developers know a few and it only takes messing up one to break someone's flow. Readline keybindings should be sacred in terminal inputs.

Overall great job though, opencode looks beautiful! I'm rooting for you!

@net commented on GitHub (May 15, 2025): Similarly none of the readline keybindings should default to anything other than their standard behavior: - `ctrl+f` should move forward one character, not open a file picker - `ctrl-e` should jump to the end of the line, not open `$EDITOR` - `ctrl-u` should delete from the cursor to the beginning of the line - `ctrl-k` should delete from the cursor to the end of the line, not open the command pallet - `ctrl-n` should move down one line I'm sure there's more but these are just the few that made using the input unusable for me. I know not everyone knows every single readline keybinding, but many developers know a few and it only takes messing up one to break someone's flow. Readline keybindings should be sacred in terminal inputs. Overall great job though, opencode looks beautiful! I'm rooting for you!
Author
Owner

@adamdotdevin commented on GitHub (May 15, 2025):

Similarly none of the readline keybindings should default to anything other than their standard behavior:

  • ctrl+f should move forward one character, not open a file picker
  • ctrl-e should jump to the end of the line, not open $EDITOR
  • ctrl-u should delete from the cursor to the beginning of the line
  • ctrl-k should delete from the cursor to the end of the line, not open the command pallet
  • ctrl-n should move down one line

I'm sure there's more but these are just the few that made using the input unusable for me.

I know not everyone knows every single readline keybinding, but many developers know a few and it only takes messing up one to break someone's flow. Readline keybindings should be sacred in terminal inputs.

Overall great job though, opencode looks beautiful! I'm rooting for you!

yep, agreed, i generally hate all things keybinds currently in the app; i think moving everything to /<command> maybe gets us there? once we're on latest bubbletea we can use cmd maybe? cmd+k, for instance, opening the commands dialog... that makes sense

@adamdotdevin commented on GitHub (May 15, 2025): > Similarly none of the readline keybindings should default to anything other than their standard behavior: > > * `ctrl+f` should move forward one character, not open a file picker > * `ctrl-e` should jump to the end of the line, not open `$EDITOR` > * `ctrl-u` should delete from the cursor to the beginning of the line > * `ctrl-k` should delete from the cursor to the end of the line, not open the command pallet > * `ctrl-n` should move down one line > > I'm sure there's more but these are just the few that made using the input unusable for me. > > I know not everyone knows every single readline keybinding, but many developers know a few and it only takes messing up one to break someone's flow. Readline keybindings should be sacred in terminal inputs. > > Overall great job though, opencode looks beautiful! I'm rooting for you! yep, agreed, i generally hate all things keybinds currently in the app; i think moving everything to `/<command>` maybe gets us there? once we're on latest bubbletea we can use `cmd` maybe? `cmd+k`, for instance, opening the commands dialog... that makes sense
Author
Owner

@net commented on GitHub (May 15, 2025):

I wouldn't use cmd for any default keybindings. I feel like there's sort of an unspoken rule that cmd is for the emulator program (iTerm, Ghostty, VS Code, etc.), and if the user wants to configure cmd key maps for a TUI program that's something they do themselves (with the knowledge of what emulator they're using). It's also not very cross-platform friendly, of course.

There's plenty of free ctrl and alt keybindings that don't conflict with the main readline keybindings :)

@net commented on GitHub (May 15, 2025): I wouldn't use `cmd` for any default keybindings. I feel like there's sort of an unspoken rule that `cmd` is for the emulator program (iTerm, Ghostty, VS Code, etc.), and if the user wants to configure `cmd` key maps for a TUI program that's something they do themselves (with the knowledge of what emulator they're using). It's also not very cross-platform friendly, of course. There's plenty of free `ctrl` and `alt` keybindings that don't conflict with the main readline keybindings :)
Author
Owner

@l0gicgate commented on GitHub (May 15, 2025):

There are so many different preferences when it comes to keybindings, we should just make it fully customizable via the config file. It's not that heavy of a lift imo. I will gladly volunteer to implement it if we decide to go this route.

@l0gicgate commented on GitHub (May 15, 2025): There are so many different preferences when it comes to keybindings, we should just make it fully customizable via the config file. It's not that heavy of a lift imo. I will gladly volunteer to implement it if we decide to go this route.
Author
Owner

@adamdotdevin commented on GitHub (May 15, 2025):

yeah, we need to do both; they need to be configurable and we need way better defaults

@adamdotdevin commented on GitHub (May 15, 2025): yeah, we need to do both; they need to be configurable and we need way better defaults
Author
Owner

@nacho-vazquez commented on GitHub (Jun 11, 2025):

We need to start thinking about moving to Lipgloss v2. The progressive keyboard enhancements will shine here.

https://github.com/charmbracelet/bubbletea/discussions/1374

I'm open to helping with the migration. Just let me know.

@nacho-vazquez commented on GitHub (Jun 11, 2025): We need to start thinking about moving to Lipgloss v2. The progressive keyboard enhancements will shine here. https://github.com/charmbracelet/bubbletea/discussions/1374 I'm open to helping with the migration. Just let me know.
Author
Owner

@adamdotdevin commented on GitHub (Jun 11, 2025):

i've already moved over on #38 just have to push my commits

@adamdotdevin commented on GitHub (Jun 11, 2025): i've already moved over on #38 just have to push my commits
Author
Owner

@nacho-vazquez commented on GitHub (Jun 11, 2025):

Nice!

@nacho-vazquez commented on GitHub (Jun 11, 2025): Nice!
Author
Owner

@thdxr commented on GitHub (Jun 14, 2025):

going to close for now as 0.1.x is a rewrite. feel free to open a new issue if it's still a problem

@thdxr commented on GitHub (Jun 14, 2025): going to close for now as 0.1.x is a rewrite. feel free to open a new issue if it's still a problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12