Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Ignore commands on incompleted lines. #762

envygeeks opened this Issue · 5 comments

3 participants

[1] pry(main)> class Example1
[1] pry(main)*   def exit
[1] pry(main)*     exit

Pry should ignore commands on incomplete lines since commands (without a dash) can severely conflict with code (even if it is dumb code and I know it is.) I think it would be a good assumption for pry to make... that in the middle of doing something, we aren't wanting to type commands so they should be ignored (or unless we explicitly enable command parsing on incomplete lines?)


if we allowed this then commands like edit, amend-line and play would lose half their power.


Again that pesky exit command.

That's the real issue here.


@rking, no that is not the real issue. @banister so the function of 3 commands outweigh the users ability to option out parsing commands during continued lines? If that's the case, then what is Pry's use? Can't be an REPL considering your commands now think they are more important than my code. We really can't have an option to disable this obtrusive design?


@envygeeks This is just a matter of commands conflicting with code. There are a few ways to resolve it: 1. use a Pry.config.command_prefix 2. Prefix a space before you type the command name 3. Turn on command collision warnings (Pry.config.collision_warnings = true) 4. Disable or rename the annoying commands (Pry.commands.delete "exit")

I think the ability of edit to operate mid-expression is very cool, and I would like to keep it, similarly I am a heavy user of amend-line and even show-source mid-expression and would like to keep them as well.

Realistically it's only exit causing you these problems, right? if this is the case you can rename it (and other annoying commands) in your .pryrc: Pry.commands.rename_command "%exit", "exit"


@banister Actually you just mitigated all my concerns with the mention of the command_prefix option you mentioned, and you are right that it's just mostly exit that was killing me. There was a few times where edit got in the way but I fixed that by doing some trickery to call the edit method while in the context.

You are right that it's pretty legit to be able to edit in the middle of doing something but it was just in the way for me but now that you've mentioned that I can prefix commands (which I should have known all along) I can fix the entire situation for me personally.

@banister banister closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.