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:
Binary file not shown.
@@ -199,6 +199,10 @@ class TerminalSession: NSObject, NSTextViewDelegate, NSMenuDelegate {
|
||||
func showPrompt() {
|
||||
appendText("$ ")
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user