Fix cursor positioning after command execution

- Cursor now automatically moves to end of prompt after Enter
- Text view becomes first responder automatically
- No need to click to start typing after command execution
This commit is contained in:
2026-01-31 23:30:40 +00:00
parent 5cf9701bc9
commit bbff54b7a9
3 changed files with 4 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -199,6 +199,10 @@ class TerminalSession: NSObject, NSTextViewDelegate, NSMenuDelegate {
func showPrompt() { func showPrompt() {
appendText("$ ") appendText("$ ")
promptPosition = textView.string.count promptPosition = textView.string.count
// Move cursor to end and make text view first responder
textView.setSelectedRange(NSRange(location: textView.string.count, length: 0))
textView.window?.makeFirstResponder(textView)
} }
func appendText(_ text: String) { func appendText(_ text: String) {