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

~/.pry_history not read in when using Ruby version 2.2.1 #1394

Closed
mecampbellsoup opened this issue Mar 13, 2015 · 4 comments
Closed

~/.pry_history not read in when using Ruby version 2.2.1 #1394

mecampbellsoup opened this issue Mar 13, 2015 · 4 comments

Comments

@mecampbellsoup
Copy link

Using 2.1.4, you can see reverse history search works (note the bck prompt, indicated I'm in a reverse history search process):

matthewcampbell@Matthews-MacBook-Pro:~|
⇒  rbenv local 2.1.4
matthewcampbell@Matthews-MacBook-Pro:~|
⇒  pry
no awesome_print :(
input> matt.trips
bck:trips

Using 2.2.0, history/reverse search still functional:

matthewcampbell@Matthews-MacBook-Pro:~|
⇒  rbenv local 2.2.0
matthewcampbell@Matthews-MacBook-Pro:~|
⇒  pry
no awesome_print :(
input> Ticket.whaled.count
bck:Ticket

Now, using 2.2.1 and searching once again for the string "Ticket", history breaks:

matthewcampbell@Matthews-MacBook-Pro:~|
⇒  rbenv local 2.2.1
matthewcampbell@Matthews-MacBook-Pro:~|
⇒  pry
no awesome_print :(
input>
bck?Ticket
@mecampbellsoup mecampbellsoup changed the title .pry_history not read in when using Ruby version 2.2.1 ~/.pry_history not read in when using Ruby version 2.2.1 Mar 13, 2015
@richardkmichael
Copy link

Hmm, can you elaborate ; or, have I misunderstood?

This works OK for me -- ruby 2.2.1 compiled against real readline (which IIRC is the rbenv default), not MacOS' "libedit".

$ pry -e east-coker

  --
  Now the light falls
  Across the open field, leaving the deep lane
  Shuttered with branches, dark in the afternoon,
  Where you lean against a bank while a van passes,
  And the deep lane insists on the direction
  Into the village, in the electric heat
  Hypnotised. In a warm haze the sultry light
  Is absorbed, not refracted, by grey stone.
  The dahlias sleep in the empty silence.
  Wait for the early owl.
                -- T.S Eliot

[2] pry(main)> hist # Show session history, then (via readline/CTRL-r) reverse-search through "full history" ; could be shown with "hist --all".
1: east-coker
(reverse-i-search)`DB': DB = Sequel.sqlite 'data.sqlite'
[3] pry(main)> Readline::HISTORY.count # Show full history is indeed loaded.
=> 4980
[4] pry(main)> RUBY_DESCRIPTION
=> "ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin12.0]"

In case it helps,

find ~/.rbenv/versions/2.2.1 -iname \*readline\*bundle\* -exec otool -L {} \;
/Users/testuser/.rbenv/versions/2.2.1/lib/ruby/2.2.0/x86_64-darwin12.0/readline.bundle:
        /usr/local/opt/readline/lib/libreadline.6.dylib (compatibility version 6.0.0, current version 6.3.0)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

@mecampbellsoup
Copy link
Author

Yea I'm working again now, not sure what was going on but probably an issue isolate to my environment/machine. Cheers @richardkmichael

@richardkmichael
Copy link

@mecampbellsoup No problem, I was investigating some other history related curiosities and decided to check this out too. Can you close this issue?

@Domon
Copy link

Domon commented Apr 1, 2015

Thanks @richardkmichael for the command finding readline bundle. It helps me a lot. 😄

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

No branches or pull requests

3 participants