Next: Diary and Echo Commands, Previous: Customizing readline, Up: Command Line Editing
The following variables are available for customizing the appearance of the command-line prompts. Octave allows the prompt to be customized by inserting a number of backslash-escaped special characters that are decoded as follows:
The primary prompt string. When executing interactively, Octave displays the primary prompt
PS1
when it is ready to read a command.The default value of
PS1
is"\s:\#> "
. To change it, use a command likeoctave:13> PS1 = "\\u@\\H> "which will result in the prompt `boris@kremvax> ' for the user `boris' logged in on the host `kremvax.kgb.su'. Note that two backslashes are required to enter a backslash into a string. See Strings.
The secondary prompt string, which is printed when Octave is expecting additional input to complete a command. For example, when defining a function over several lines, Octave will print the value of
PS1
at the beginning of each line after the first. The default value ofPS2
is"> "
.
If Octave is invoked with the
--echo-commands
option, the value ofPS4
is printed before each line of input that is echoed. The default value ofPS4
is"+ "
. See Invoking Octave, for a description of--echo-commands
.