aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-02-10 15:47:09 +0000
committerErlang/OTP <[email protected]>2010-02-10 15:47:09 +0000
commit64a697339414f424073c5b021285fddb0ff2d9da (patch)
tree9fd383967b8456a31163d32d57cf7bf31c697051 /lib/kernel
parent97cd65dfbbc1a64632962fc8369700bfcfebea44 (diff)
downloadotp-64a697339414f424073c5b021285fddb0ff2d9da.tar.gz
otp-64a697339414f424073c5b021285fddb0ff2d9da.tar.bz2
otp-64a697339414f424073c5b021285fddb0ff2d9da.zip
OTP-8418 user.erl (used in oldshell) is updated to handle unicode in
prompt strings (io:get_line/{1,2}). io_lib is also updated to format prompts with the 't' modifier (i.e. ~ts instead of ~s).
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/src/user.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/kernel/src/user.erl b/lib/kernel/src/user.erl
index edf650ec59..17dc5a56a2 100644
--- a/lib/kernel/src/user.erl
+++ b/lib/kernel/src/user.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% 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.
-%%
+%%
%% %CopyrightEnd%
%%
-module(user).
@@ -698,7 +698,11 @@ get_chars_more(State, M, F, Xa, Port, Q, Fmt) ->
prompt(_Port, '') -> ok;
prompt(Port, Prompt) ->
- put_port(io_lib:format_prompt(Prompt), Port).
+ put_port(wrap_characters_to_binary(io_lib:format_prompt(Prompt),unicode,
+ case get(unicode) of
+ true -> unicode;
+ _ -> latin1
+ end), Port).
%% Convert error code to make it look as before
err_func(io_lib, get_until, {_,F,_}) ->