aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-02-18 15:12:37 +0100
committerPatrik Nyblom <[email protected]>2013-02-18 15:12:37 +0100
commit568cb052c7be7e36f96ddd18001529e371790b4b (patch)
tree2e388f737a12f26cb0775900b593b772a8f9b590 /lib/stdlib/src
parentd017d6d6dff3c709989fec37fff40bc0dd715128 (diff)
downloadotp-568cb052c7be7e36f96ddd18001529e371790b4b.tar.gz
otp-568cb052c7be7e36f96ddd18001529e371790b4b.tar.bz2
otp-568cb052c7be7e36f96ddd18001529e371790b4b.zip
Leave the +pc handling to io and io_lib_pretty
This makes the shell output binaries and list as intended by the +pc setting.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/shell.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl
index c90b5ad5c8..96f3e5dd32 100644
--- a/lib/stdlib/src/shell.erl
+++ b/lib/stdlib/src/shell.erl
@@ -570,7 +570,7 @@ report_exception(Class, Severity, {Reason,Stacktrace}, RT) ->
I = iolist_size(Tag) + 1,
PF = fun(Term, I1) -> pp(Term, I1, RT) end,
SF = fun(M, _F, _A) -> (M =:= erl_eval) or (M =:= ?MODULE) end,
- Enc = io:printable_range(),
+ Enc = encoding(),
Str = lib:format_exception(I, Class, Reason, Stacktrace, SF, PF, Enc),
io:requests([{put_chars, latin1, Tag},
{put_chars, unicode, Str},
@@ -1384,9 +1384,14 @@ columns() ->
{ok,N} -> N;
_ -> 80
end.
-
+encoding() ->
+ [{encoding, Encoding}] = enc(),
+ Encoding.
enc() ->
- [{encoding, io:printable_range()}].
+ case lists:keyfind(encoding, 1, io:getopts()) of
+ false -> [{encoding,latin1}]; % should never happen
+ Enc -> [Enc]
+ end.
garb(Shell) ->
erlang:garbage_collect(Shell),