Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Aug 2, 2022

In some case, modified lines was passed to auto_indent_proc.

This pullreq will fix some prompt bug in irb.

irb(main):002:1* if 1
irb(main):003:1"   %[
irb(main):004:13>   a a a a

# should be 
irb(main):006:1"   a a a a

image

@nobu
Copy link
Member

nobu commented Sep 1, 2022

Could you add tests?

@tompng
Copy link
Member Author

tompng commented Sep 2, 2022

Added a test to reproduce it in test code.

It happens when

  • Just after completion dialog is closed
  • output_modifier_proc is set
  • prompt_proc returns lines.size+1 prompts

@hasumikin
Copy link
Collaborator

I could confirm this patch works well on:

  • WSL2 Ubuntu-22.04 + Windows terminal + tmux next-3.4 +
    ruby 3.2.0dev (2022-12-08T07:24:21Z master 516fe62734) [x86_64-linux]
  • Windows PowerShell +
    ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x64-mingw-ucrt]

Also, the test code made sense 👍

@tompng ima1zumi and I are new maintainers of ruby/reline.
We recently discussed Reline's maintenance policy targeting the end of this year (2022) and then decided we basically don't merge any PR (except emergency ones) before releasing reline 0.3.2 in order to keep the next Ruby 3.2 stable.
We'll check the rest of your PRs in turn :)

@ima1zumi I think I would be able to merge this PR after the Ruby 3.2 release. Besides, it'll be better if you could briefly check on Terminal.app (iTerm2.app?) of macOS (or if I could get a new Mac🍎

@ima1zumi
Copy link
Member

Thank you for fixing it 🌟
I could confirm this patch works well on:

OS TERM Terminal Ruby irb
macOS 12.4 ANSI Terminal.app Version 2.12.7 (445) 3.2.0-rc1 HEAD(d30c0c9)
macOS 12.4 xterm-256color iTerm2 Build 3.4.10 3.2.0-rc1 HEAD(d30c0c9)
macOS 12.4 screen-256color Alacritty 0.10.0-dev (8cda3d14) + tmux 3.2 3.2.0-rc1 HEAD(d30c0c9)

@hasumikin hasumikin merged commit 0f00744 into ruby:master Jan 12, 2023
matzbot pushed a commit to ruby/ruby that referenced this pull request Jan 12, 2023
sequence) to check_multiline_prompt
(ruby/reline#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
@ima1zumi ima1zumi added the bug Something isn't working label Mar 27, 2023
@tompng tompng deleted the fix_multiline_prompt_escape_sequence branch July 19, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants