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

Suppress irb_info measures ambiguous_width in command test #1074

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

tompng
Copy link
Member

@tompng tompng commented Jan 24, 2025

Some test in test/irb/test_command.rb, irb_info measures ambiguous width by unicode character "\u{25bd}" and escape sequence "\e[6n".

It is used here.

irb(main):001> irb_info
...
East Asian Ambiguous Width: [To show this value]

This pull request suppresses it.

Actual problem

When running rake test through this command, ▽^[3;1R will be displayed in terminal screen for about 0.5 second.

ruby -rpty -e "PTY.spawn('rake test'){|r,w|loop{STDOUT.write r.readpartial(10) rescue break}}"

When running rake test through this command in tty terminal, test hangs up with displayed in terminal screen.
This is because STDIN.raw hangs up for unknown reason.

ruby -e "Process.waitpid spawn('rake test', pgroup: true)"

The latter one that uses spawn with pgroup: true was used in ruby/ruby's tool/test-bundled-gems.rb.
https://github.com/ruby/ruby/blob/dd863714bf377b044645ea12b4db48920d49694e/tool/test-bundled-gems.rb#L82
It looks like ci passes because it runs in non-tty environment. (Reline::IOGate is Reline::Dumb)

@hsbt hsbt mentioned this pull request Jan 27, 2025
@tompng tompng merged commit 5623f0a into ruby:master Jan 27, 2025
33 of 34 checks passed
@tompng tompng deleted the irb_info_no_ambiguous branch January 27, 2025 11:41
@st0012
Copy link
Member

st0012 commented Jan 27, 2025

This is great 👍

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

Successfully merging this pull request may close these issues.

2 participants