aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/shell.xml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/doc/src/shell.xml')
-rw-r--r--lib/stdlib/doc/src/shell.xml49
1 files changed, 43 insertions, 6 deletions
diff --git a/lib/stdlib/doc/src/shell.xml b/lib/stdlib/doc/src/shell.xml
index 24b845fee9..73cc1b33bd 100644
--- a/lib/stdlib/doc/src/shell.xml
+++ b/lib/stdlib/doc/src/shell.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>shell</title>
@@ -333,10 +333,12 @@ undefined
&lt;0.57.0>
27> <input>get(aa).</input>
hello
-28> <input>io:format("hello hello\ ").</input>
-hello hello ok
+28> <input>io:format("hello hello\n").</input>
+hello hello
+ok
29> <input>e(28).</input>
-hello hello ok
+hello hello
+ok
30> <input>v(28).</input>
ok
31> <input>c(ex).</input>
@@ -737,6 +739,28 @@ loop(N) ->
returns <c>{error,Reason}</c>.</item>
</list>
</section>
+
+ <section>
+ <title>Prompting</title>
+ <p>The default shell prompt function displays the name of the node
+ (if the node can be part of a distributed system) and the
+ current command number. The user can customize the prompt
+ function by calling
+ <c>shell:prompt_func/1</c> or by setting the application
+ configuration parameter <c>shell_prompt_func</c> for the
+ application STDLIB.</p>
+ <p>A customized prompt function is stated as a tuple
+ <c>{Mod,&nbsp;Func}</c>. The function is called as
+ <c>Mod:Func(L)</c>, where <c>L</c> is a list of key-value pairs
+ created by the shell. Currently there is only one pair:
+ <c>{history, N}</c>, where N is the current command number. The
+ function should return a list of characters or an atom. This
+ constraint is due to the Erlang I/O-protocol. Unicode characters
+ beyond codepoint 255 are allowed in the list. Note
+ that in restricted mode the call <c>Mod:Func(L)</c> must be
+ allowed or the default shell prompt function will be called.</p>
+ </section>
+
<funcs>
<func>
<name>history(N) -> integer()</name>
@@ -780,6 +804,19 @@ loop(N) ->
</desc>
</func>
<func>
+ <name>prompt_func(PromptFunc) -> prompt_func()</name>
+ <fsummary>Sets the shell prompt</fsummary>
+ <type>
+ <v>PromptFunc = prompt_func()</v>
+ <v>prompt_func() = default | {Mod, Func}</v>
+ <v>Mod = Func = atom()</v>
+ </type>
+ <desc>
+ <p>Sets the shell prompt function to <c>PromptFunc</c>. The
+ previous prompt function is returned.</p>
+ </desc>
+ </func>
+ <func>
<name>start_restricted(Module) -> ok | {error, Reason}</name>
<fsummary>Exits a normal shell and starts a restricted shell.</fsummary>
<type>