Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With irb --noreadline --nomultiline there is an unnecessary newline before each prompt #990

Closed
frou opened this issue Aug 18, 2024 · 3 comments · Fixed by #1014
Closed

Comments

@frou
Copy link

frou commented Aug 18, 2024

Description

When running irb with the flags --noreadline --nomultiline, there is an unnecessary additional newline before each prompt, including the initial prompt.

I originally noticed this in Emacs (the inf-ruby package runs irb with those flags), but I can also reproduce it in a normal terminal with no Emacs involved. As shown in this screenshot:

Screenshot 2024-08-18 at 13 04 04

The next screenshot shows it working as expected (when not using that combination of flags):
Screenshot 2024-08-18 at 13 05 04

Result of irb_info

irb(main):001> irb_info
Ruby version: 3.3.4
IRB version: irb 1.14.0 (2024-07-06)
InputMethod: StdioInputMethod
Completion: off
RUBY_PLATFORM: x86_64-darwin21
LANG env: en_GB.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

iTerm2 v3.5.4

Setting Files

Are you using ~/.irbrc and ~/.inputrc?

No

@tompng
Copy link
Member

tompng commented Aug 18, 2024

Related to #943

@frou
Copy link
Author

frou commented Oct 7, 2024

Maybe a temporary fix could be to not do the puts if the INSIDE_EMACS environment variable is defined.

@dgutov
Copy link
Contributor

dgutov commented Oct 7, 2024

That's definitely an option. @tompng ?

I think we need to do something. #907 was aimed at making the behavior more regular, needing fewer workarounds.

But because of the "test workaround", the latest Irb has been strictly worse in Emacs for the last 6 months, spanning 2 minor versions and 4 patch releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants