Skip to content

Conversation

@trobrock
Copy link

@trobrock trobrock commented Dec 3, 2025

Summary

This allows the customization of the kebinding in the CLI to be customized using the GOOSE_CLI_NEWLINE_KEY.

For example (CTRL-N will enter a newline):

GOOSE_CLI_NEWLINE_KEY="n" goose

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Unit tests have been added.
I also manually tested this.

Copilot AI review requested due to automatic review settings December 3, 2025 00:43
@trobrock trobrock force-pushed the custom-new-line-key branch from be28b3b to e8fdc51 Compare December 3, 2025 00:44
Copilot finished reviewing on behalf of trobrock December 3, 2025 00:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds customization support for the CLI newline keybinding through the GOOSE_CLI_NEWLINE_KEY environment variable, allowing users to change from the default Ctrl+J to any other Ctrl+ combination.

Key Changes

  • Added get_newline_key() function to read and validate the environment variable with sensible defaults
  • Updated all user-facing documentation (system prompt, help text, and comments) to reflect the customizable keybinding
  • Added comprehensive unit tests covering default behavior, custom keys, edge cases (empty strings, multi-char strings, case conversion)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/goose-cli/src/session/input.rs Implements the configurable keybinding logic, updates help text, and adds unit tests
crates/goose-cli/src/session/prompt.rs Updates the system prompt to dynamically show the configured keybinding

Signed-off-by: Trae Robrock <[email protected]>
@trobrock trobrock force-pushed the custom-new-line-key branch from 7d54e73 to 7c0bff8 Compare December 3, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant