sequence) to check_multiline_prompt
(https://github.com/ruby/reline/pull/458)
* pass unmodified lines to check_multiline_prompt
* Add test to check that output modified by output_modifier_proc is not passed to prompt_proc
JRuby 9.4.0.0 introduced a change in case sensitivity in require statements,
meaning that an inclusion of `win32api` loaded Win32API.rb. With this change,
the require statement needs to be updated to the correct capitalization of the
filename to avoid reline failures in newer versions of JRuby.
https://github.com/ruby/reline/commit/d6e7c9e1d9
These APIs/configs are not approved by the Ruby core, so they can't be
released to the public. This means having them in the codebase will
block other fixes/features from being released as well.
So this commit removes those exposed interfaces to unblock the release.
Hopefully when https://bugs.ruby-lang.org/issues/18996 is approved we
can re-implement better APIs.
https://github.com/ruby/reline/commit/f7a961c550
- Obviously, `tim` is a typo for `time`
- This didn't cause an exception because IO#raw is implemented in C and it doesn't check the keyword of the parameters
- Though this typo doesn't produce any problems for now, I think it should be fixed just in case for the future
- I've used this fixed version of Reline with IRB for several days and didn't find any new problems due to the fix
- But I myself am not sure how to make sure this fix is completely robust
https://github.com/ruby/reline/commit/e66a9696a1
"Pointer" is not what we usually use to describe a selected item.
"Highlight" is a more common word for the scenario so we should use it instead.
https://github.com/ruby/reline/commit/b4279d1557
As pointed out in the
[comment](https://github.com/ruby/reline/pull/413#issuecomment-1168033973),
the code is actually a control sequence and not only for colors.
To make the dialog color APIs safer to use, we should restrict its
usages and extract away the bg/fg concept from the input.
So in this commit, I made these changes:
1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol):
- :black
- :red
- :green
- :yellow
- :blue
- :magenta
- :cyan
- :white
2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.
https://github.com/ruby/reline/commit/b32a977766
This maybe isn't probably isn't the best approach, but it will allow
`Fiddle::Terminfo.curses_dl` to work. I documented more details about
this in an issue on fiddle: https://github.com/ruby/fiddle/issues/107
It is probably better to deal with it there. But this is workaround is
simpler.
FYI: `reline` itself seems to be working just fine for me _without_
loading ncurses. But I wanted to be able to use `Reline::Terminfo` for
my own projects. :)
https://github.com/ruby/reline/commit/fd4bdb35e2
The existing implementation, given the below .inputrc, erroneously
creates a "C-v" key binding:
set keymap emacs-ctlx
"\C-v": "[C-x C-v was pressed]"
This fixes it to instead create a "C-x C-v" keybinding.
https://github.com/ruby/reline/commit/719f52d231
If a top-level `VERSION` constant exists, or if a module containing a `VERSION` constant is included into the top-level scope, then `Fiddle.const_defined?(:VERSION)` will erroneously return true when `RUBY_VERSION < 3.0.0`.
https://github.com/ruby/reline/commit/8529c8e47a
Solaris requires that the pointer errret_int is alined to an integer,
however, with VWA, strings are no longer aligned to an integer, so use a
Fiddle::Pointer with a malloc'd region instead.
https://github.com/ruby/reline/commit/5fcd89ab0c
The kill-line was called when C-u was entered, so it is now called unix-line-discard.
In readline(3):
> unix-line-discard (C-u)
> Kill backward from point to the beginning of the line.
> The killed text is saved on the kill-ring.
https://github.com/ruby/reline/commit/27570d195e
In some tests, the LineEditor#reset method is always called, but doesn't
need to set the signal handlers there, so cuts it out to a separate
method.
https://github.com/ruby/reline/commit/b143c4f5f9
Windows Terminal does smart screen clearing when \e 2 J (not clear entire screen but scrolls down just needed)
On consoles not support sequences, ruby still converts it to API call.
https://github.com/ruby/reline/commit/c00930dab9
When merged to ruby/ruby, reline.gemspec file is located under
lib/reline, as the same as reline/version.rb. That is the latter
path relative from the former differs from the ruby/reline case,
and the reline/version.rb in the default load path will be loaded.
Try `require_relative` not to load unexpected files.
https://github.com/ruby/reline/commit/54905d0e1b
The number of lines below the cursor position was known by
"@rest_height" alone, but the problem was caused by adding
"lower_space". Remove "lower_space" as it is unnecessary.
https://github.com/ruby/reline/commit/a575cef6a3
If Reline::IOGate.encoding contains 7-bit characters, convert-meta will set it On.
Because in readline(3):
> The default is On, but readline will set it to Off if the locale contains eight-bit characters.
As far as I know, 7-bit encoding used in terminals is only US-ASCII.
https://github.com/ruby/reline/commit/b71d1fa496
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>
fix https://github.com/ruby/irb/issues/308
This bug occurred when `dialog.width - calculate_width(s, true)` was negative.
When `dialog.width` is shorter than `old_dialog.width`, it calculates how much padding it has to do. However, there are cases where `s` is longer than `dialog.width`, as in the issue. In that case, `padding_space_with_escape_sequences` will crash.
Here, `old_dialog.width` is longer than `dialog.width`, so I changed the padding width to `old_dialog.width - dialog.width`.
https://github.com/ruby/reline/commit/c581c31e0f
Fixes a crash in IRB if a dialog is displayed and the default
external encoding is not UTF-8:
/home/jeremy/tmp/reline/lib/reline/line_editor.rb:731:in `write': U+2588 from UTF-8 to US-ASCII (Encoding::UndefinedConversionError)
https://github.com/ruby/reline/commit/f570525ecd