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

irb3.0 no longer does tab completion on filenames #198

Closed
simon-dedeo opened this issue Mar 8, 2021 · 4 comments · Fixed by #212
Closed

irb3.0 no longer does tab completion on filenames #198

simon-dedeo opened this issue Mar 8, 2021 · 4 comments · Fixed by #212

Comments

@simon-dedeo
Copy link

simon-dedeo commented Mar 8, 2021

Description

in irb2.5:

rb(main):001:0> source 'li [then I hit tab...]
linking.rb list_load.rb list_load_OLD.rb

irb(main):001:0> source 'lis [then I hit tab again...]
list_load.rb list_load_OLD.rb

irb(main):001:0> source 'list_load.rb' [then I hit tab again...]

in irb3.0, hitting tab after typing "source 'li" gives.

irb(main):001:0' source 'li'

Result of irb_info

Ruby version: 3.0.0
IRB version: irb 1.3.4 (2021-02-25)
InputMethod: ReidlineInputMethod with Reline 0.2.0 and /Users/simon/.inputrc
.irbrc path: /Users/simon/.irbrc
RUBY_PLATFORM: x86_64-darwin16

Terminal Emulator

Mac OS X (10.12.6)

Setting Files

ayerie:~ simon$ cat .inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

ayerie:~ simon$ cat /Users/simon/.irbrc
[standard text, it seems]

module Readline
  module History
    LOG = "#{ENV['HOME']}/.irb-history"

    def self.write_log(line)
      File.open(LOG, 'ab') {|f| f << "#{line}
"}
    end

    def self.start_session_log
      write_log("
# session start: #{Time.now}

")
      at_exit { write_log("
# session stop: #{Time.now}
") }
    end
  end

  alias :old_readline :readline
  def readline(*args)
    ln = old_readline(*args)
    begin
      History.write_log(ln)
    rescue
    end
    ln
  end
end

Readline::History.start_session_log
@aycabta
Copy link
Member

aycabta commented Mar 9, 2021

The default completion logic in GNU Readline is filename completion, as IRB-specific completion was disabled before Ruby 2.6, so filenames were completed everywhere. So filename completion no longer works for now.

@sdedeo
Copy link

sdedeo commented Mar 9, 2021

Thank you!

@marcandre marcandre added the wontfix This will not be worked on label Mar 21, 2021
@marcandre
Copy link
Member

Closing, as there won't be a fix.

Or did I misunderstand @aycabta and you are considering doing tab completion for paths when typing a string?

@aycabta aycabta removed the wontfix This will not be worked on label Mar 24, 2021
@aycabta aycabta reopened this Mar 24, 2021
@aycabta
Copy link
Member

aycabta commented Mar 24, 2021

This is implemented by #212.

@aycabta aycabta closed this as completed Mar 24, 2021
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.

4 participants