Skip to content

Commit cc2242a

Browse files
committed
Missed a couple of places that hard code J for the newline key
1 parent 3d4a20f commit cc2242a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

crates/goose-cli/src/session/completion.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,11 @@ impl Hinter for GooseCompleter {
390390
fn hint(&self, line: &str, _pos: usize, _ctx: &Context<'_>) -> Option<Self::Hint> {
391391
// Only show hint when line is empty
392392
if line.is_empty() {
393-
Some("Press Enter to send, Ctrl-J for new line".to_string())
393+
let newline_key = super::input::get_newline_key().to_ascii_uppercase();
394+
Some(format!(
395+
"Press Enter to send, Ctrl-{} for new line",
396+
newline_key
397+
))
394398
} else {
395399
None
396400
}

crates/goose-cli/src/session/input.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ pub fn get_input(
8383
return Ok(InputResult::Message(message));
8484
}
8585

86-
// Ensure Ctrl-J binding is set for newlines
86+
let newline_key = get_newline_key();
8787
editor.bind_sequence(
88-
rustyline::KeyEvent(rustyline::KeyCode::Char('j'), rustyline::Modifiers::CTRL),
88+
rustyline::KeyEvent(
89+
rustyline::KeyCode::Char(newline_key),
90+
rustyline::Modifiers::CTRL,
91+
),
8992
rustyline::EventHandler::Simple(rustyline::Cmd::Newline),
9093
);
9194

0 commit comments

Comments
 (0)