summaryrefslogtreecommitdiff
path: root/test/reline/yamatanooroti
diff options
context:
space:
mode:
authorima1zumi <mariimaizumi5@gmail.com>2021-11-22 21:16:20 +0900
committergit <svn-admin@ruby-lang.org>2021-12-10 22:19:14 +0900
commit519a945efcb0205bdf4085e32cc76e56610a45c0 (patch)
treeff67688ac49802a36fdede27604f8c87c9a7384a /test/reline/yamatanooroti
parent3a2ae5bb19a653ac131136c6bf9a7550f64804f6 (diff)
downloadruby-519a945efcb0205bdf4085e32cc76e56610a45c0.tar.gz
[ruby/reline] Execute compress_meta_key if convert_meta is on
fix `#357` When using 8-bit characters, it is better not to use `compress_meta_key`. I believe not to use `compress_meta_key` unless `set convert-meta on` is written in the `.inputrc`. The following is a quote from tmtm's comments. > The behavior of this compress_meta_key method is similar to the behavior of convert-meta=on in readline, but readline turns off convert-meta if the locale contains 8bit characters. > In readline(3): > convert-meta (On) > If set to On, readline will convert characters with the eighth > bit set to an ASCII key sequence by stripping the eighth bit and > prefixing it with an escape character (in effect, using escape > as the meta prefix). The default is On, but readline will set > it to Off if the locale contains eight-bit characters. https://github.com/ruby/reline/commit/9491cc8542 Co-authored-by: TOMITA Masahiro <tommy@tmtm.org>
Diffstat (limited to 'test/reline/yamatanooroti')
-rw-r--r--test/reline/yamatanooroti/test_rendering.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index f68b614327..7ac426cfb4 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -739,6 +739,16 @@ begin
EOC
end
+ def test_not_meta_key
+ start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
+ write("おだんご") # "だ" in UTF-8 contains "\xA0"
+ close
+ assert_screen(<<~EOC)
+ Multiline REPL.
+ prompt> おだんご
+ EOC
+ end
+
def test_force_enter
start_terminal(30, 120, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("def hoge\nend\C-p\C-e")