Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(macos): insert a newline with shift-return

Sean Fergusonf0abd800b615
diff --git a/kit/Sources/CodyncUI/Platform.swift b/kit/Sources/CodyncUI/Platform.swift
index ca257adc..bc5d7ef6 100644
--- a/kit/Sources/CodyncUI/Platform.swift
+++ b/kit/Sources/CodyncUI/Platform.swift
@@ -56,10 +56,16 @@ extension View {
@ViewBuilder func sendOnReturn(_ send: @escaping () -> Void) -> some View {
#if os(macOS)
onKeyPress(.return, phases: .down) { press in
- guard !press.modifiers.contains(.shift) else { return .ignored }
- if let editor = NSApp.keyWindow?.firstResponder as? NSTextView, editor.hasMarkedText() {
+ let editor = NSApp.keyWindow?.firstResponder as? NSTextView
+ if editor?.hasMarkedText() == true {
return .ignored
}
+ if press.modifiers.contains(.shift) {
+ guard let editor else { return .ignored }
+ // The multiline TextField treats Return as submission, even with Shift.
+ editor.insertNewlineIgnoringFieldEditor(nil)
+ return .handled
+ }
send()
return .handled
}