2.4.1 Cursor Motion
The following commands allow you to position the cursor.
- C-b
-
Move back one character.
- C-f
-
Move forward one character.
- BACKSPACE
-
Delete the character to the left of the cursor.
- DEL
-
Delete the character underneath the cursor.
- C-d
-
Delete the character underneath the cursor.
- M-f
-
Move forward a word.
- M-b
-
Move backward a word.
- C-a
-
Move to the start of the line.
- C-e
-
Move to the end of the line.
- C-l
-
Clear the screen, reprinting the current line at the top.
- C-_
- C-/
-
Undo the last action. You can undo all the way back to an empty line.
- M-r
Undo all changes made to this line. This is like typing the ‘undo’ command enough times to get back to the beginning.
The above table describes the most basic possible keystrokes that you need in order to do editing of the input line. On most terminals, you can also use the left and right arrow keys in place of C-f and C-b to move forward and backward.
Notice how C-f moves forward a character, while M-f moves forward a word. It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words.
The function clc
will allow you to clear the screen from within Octave programs.
- : clc ()
- : home ()
Clear the terminal screen and move the cursor to the upper left corner.
© 1996–2020 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/v6.3.0/Cursor-Motion.html