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

remove n / s / c aliases #34

Closed
banister opened this issue Aug 30, 2014 · 23 comments
Closed

remove n / s / c aliases #34

banister opened this issue Aug 30, 2014 · 23 comments

Comments

@banister
Copy link
Contributor

Please. These short-cuts are great for a pure debugger, but pry has to be a REPL as well and those single letters are very, very common scratch variables. I get a lot of confused messages from people burnt by these short-cuts.

Putting the code for defining the aliases in the README (like pry-debugger does) is a decent compromise, IMO :)

thanks!

@banister banister changed the title remove n / s / c aliases remove n / s / c aliases Aug 30, 2014
@deivid-rodriguez
Copy link
Owner

Hi @banister!

I was completely unaware of this. I think I never got any complaints about it since I enabled the shortcuts by default... I guess they're all reporting the issues to you.

I like the shortcuts myself, but I don't use pry-byebug (only when I work on it), so I want it to be community driven. If this is what people want, I'm fine with it.

@grk
Copy link

grk commented Sep 8, 2014

👍 for those being optional. The error message isn't immediately obvious either:

[1] pry(main)> s = ""
Error: Cannot find local context. Did you use `binding.pry`?

@deivid-rodriguez
Copy link
Owner

Yes, the error message is not good at all.

What do you guys think about my original idea: nixme/pry-debugger#31 (comment)? Or you just prefer it's completely removed?

The problem here is that people using pry-byebug as a pry enhacement might be surprised by the current behaviour, but people using pry-byebug as a byebug enhacement might be surprised if the behaviour is changed.

So maybe my idea is a good compromise... Or maybe not...

@axos88
Copy link

axos88 commented Sep 18, 2014

Please make it optional, because I really need it.

Something like
require 'pry-debugger/one-letter-shortcuts'

@deivid-rodriguez
Copy link
Owner

I'll leave this opened for a bit longer to get more opinions, and then decide. But it does look like most people want them to be optional, indeed.

@osbornebrook
Copy link

this drives me mad. especially the scary error message, which makes it seem like something is really broken.

@dserodio
Copy link

dserodio commented Oct 1, 2014

👍 for keeping them, even if optional

@smanolloff
Copy link

its really annoying not to be able to change the hotkeys
what about single_lettter variables? I sure use them very often when debugging, to store some temp results, etc.
what about keywords - break, next, .. they have different meanings inside a loop, yet are inaccessible because the debugger does not offer to change them.
Please introduce a simple rc file for key remapping...

@deivid-rodriguez
Copy link
Owner

@smanolloff Feel free to work on any of the features you are requesting.

My current plan regarding this particular issue is to improve the error message and also refine the command. Expressions like n 5 o n = 100 are not actually ambiguos. n 5 is invalid as an expression (unless you have a method called n accepting a single mandatory argument, but I don't think that's very common). And n = 100 is invalid as a next command so it should just work. The only problem is the more frequent single n for which I'll improve the error message.

@deivid-rodriguez
Copy link
Owner

I finally removed the aliases.

Next version will be a major release in order to warn users who are used to the shortcuts.

@bbugh
Copy link

bbugh commented Oct 16, 2014

Thank you! I came here to weigh in on this as well. I am a teacher and this has caused no end of confusion to the students (and myself, when I first wasted an hour trying to figure out what was wrong with my console when I was typing n = Node.first)

@axos88
Copy link

axos88 commented Oct 22, 2014

Can we have a file that we can require for those that are used to it?

pry/shortcuts.rb:

require 'pry'
def n; next; end
def c; continue; end
def s; step; end

@dserodio
Copy link

👍

On Wed, Oct 22, 2014 at 4:48 PM, axos88 notifications@github.com wrote:

Can we have a file that we can require for those that are used to it?

pry/shortcuts.rb:

require 'pry'
def n; next; end
def c; continue; end
def s; step; end


Reply to this email directly or view it on GitHub
#34 (comment)
.

@deivid-rodriguez
Copy link
Owner

Maybe, I don't know... Are the instructions to reactivate them detailed in the README not satisfactory?

@axos88
Copy link

axos88 commented Oct 28, 2014

Haven't seen that, it's totally enough for me!

@deivid-rodriguez
Copy link
Owner

great! 👍

@alexhanh
Copy link

Oh my god, finally.

@bbugh
Copy link

bbugh commented Nov 22, 2014

Thanks for fixing this!

@benwoodward
Copy link

This had me super confused for a while! Thanks for fixing! 😺

@grk
Copy link

grk commented Jan 19, 2015

Any chance for a released version that fixes this?

@deivid-rodriguez
Copy link
Owner

I'll try to release a new version in the next three months. In the meantime just use master!

@chaimk
Copy link

chaimk commented Feb 18, 2015

OMG. Thank god I found this thread. I was using c as a variable and getting the obscure error for no apparent reason. Horrific... Thanks for changing it, and the sooner the better!

@mbigras
Copy link

mbigras commented Jan 3, 2017

For folks hitting this issue via google. You can get the shortcuts back by adding the following to your ~/.pryrc file:

if defined?(PryByebug)
  Pry.commands.alias_command 'c', 'continue'
  Pry.commands.alias_command 's', 'step'
  Pry.commands.alias_command 'n', 'next'
  Pry.commands.alias_command 'f', 'finish'
end

Taken from the README

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

Successfully merging a pull request may close this issue.