Skip to content

Disable dialog proc if TERM=dumb - #663

Merged
tompng merged 1 commit into
ruby:masterfrom
tompng:disable_generalio_dialog
Mar 24, 2024
Merged

tompng merged 1 commit into
ruby:masterfrom
tompng:disable_generalio_dialog

Conversation

@tompng

@tompng tompng commented Mar 24, 2024

Copy link
Copy Markdown
Member

When TERM=dumb (test-mode), escape sequence of completion dialog is printed. Reline didn't print it in ver <= 0.4.2.
This pull request disables adding dialog when TERM=dumb to make the test-mode difference between Reline versions.

This why TERM=dumb completion dialog was disabled in Reline < 0.4.2

class Reline::GeneralIO
  def self.get_screen_size
    [1, 1] # Rendering dialog is skipped because there is no space to render completion dialog
  end
end

In master branch, using screen_size=[1,1] is not suitable for testing. Using screen_size=[1,1] in master branch will be

$ TERM=dumb irb
i

Printing only one character to make the output fit in [1,1] is an expected behavior. (I'm not sure printing i is correct)

@tompng
tompng force-pushed the disable_generalio_dialog branch from 671d443 to 0989bb4 Compare March 24, 2024 12:45
@tompng
tompng merged commit 4928e06 into ruby:master Mar 24, 2024
@tompng
tompng deleted the disable_generalio_dialog branch March 24, 2024 13:04
@st0012 st0012 added the bug Something isn't working label Mar 25, 2024
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.

2 participants