class: TerminalView
authorClaus Gittinger <cg@exept.de>
Fri, 21 Aug 2015 15:40:21 +0200
changeset 4816 7d46a1566c69
parent 4815 c5204a7261c1
child 4817 a76ea4e5d859
class: TerminalView changed: #keyPressInLineEditMode: ctrl-a and ctrl-e
TerminalView.st
--- a/TerminalView.st	Fri Aug 21 14:16:45 2015 +0200
+++ b/TerminalView.st	Fri Aug 21 15:40:21 2015 +0200
@@ -897,7 +897,7 @@
     "readline alike line editing.
      cursorUp/down select a previous line from the history (unix shell bahevior).
      shift cursorUp selects a previous selected history line from the history (windows shell bahevior).
-     cursor left/right/backspace edit inside that line.
+     cursor left/right/^A/^E/backspace position/edit inside that line.
      Return true, if the character was processed,
      false if not. Then, the caller should proceed as usual."
 
@@ -969,6 +969,20 @@
         ^ true.
     ].
 
+    aKey == #Ctrla ifTrue:[
+        lineBufferCursorPosition > 1 ifFalse:[
+            self beep.  
+            ^ true
+        ].
+        lineBufferCursorPosition := 1.
+        self cursorToBeginOfLine.
+        ^ true.
+    ].
+    aKey == #Ctrle ifTrue:[
+        lineBufferCursorPosition := lineBuffer size.
+        self cursorToEndOfLine.
+        ^ true.
+    ].
     aKey == #CursorLeft ifTrue:[
         lineBufferCursorPosition > 1 ifFalse:[
             self beep.