-
Notifications
You must be signed in to change notification settings - Fork 121
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
Hint debugger command in irb:rdbg
session
#768
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
st0012
force-pushed
the
hint-debugger-command
branch
from
November 19, 2023 00:03
ea43ad9
to
1b49f87
Compare
tompng
reviewed
Nov 19, 2023
tompng
reviewed
Nov 19, 2023
st0012
force-pushed
the
hint-debugger-command
branch
3 times, most recently
from
November 19, 2023 08:04
5a6e72e
to
f8e5820
Compare
Good catch on both. I've updated 👍 |
tompng
reviewed
Nov 19, 2023
tompng
reviewed
Nov 19, 2023
st0012
force-pushed
the
hint-debugger-command
branch
from
November 20, 2023 16:41
f8e5820
to
c0eb8fd
Compare
st0012
force-pushed
the
hint-debugger-command
branch
from
November 22, 2023 23:31
c0eb8fd
to
bc3109b
Compare
When user enters irb:rdbg session, they don't get the same hint that the `debug` gem provides, like ``` (rdbg) n # next command ``` This means that users may accidentally execute commands when they want to retrieve the value of a variable. So this commit adds a Reline output modifier to add a simiar hint: ``` irb:rdbg(main):002> n # debug command ``` It is not exactly the same as `debug`'s because in this case the importance is to help users distinguish between value evaluation and debugger command execution.
st0012
force-pushed
the
hint-debugger-command
branch
from
November 22, 2023 23:32
bc3109b
to
d1d84ed
Compare
tompng
approved these changes
Nov 23, 2023
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Nov 23, 2023
(ruby/irb#768) When user enters irb:rdbg session, they don't get the same hint that the `debug` gem provides, like ``` (rdbg) n # next command ``` This means that users may accidentally execute commands when they want to retrieve the value of a variable. So this commit adds a Reline output modifier to add a simiar hint: ``` irb:rdbg(main):002> n # debug command ``` It is not exactly the same as `debug`'s because in this case the importance is to help users distinguish between value evaluation and debugger command execution. ruby/irb@fdf24de851
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
In ruby/debug#1024 (comment), @ko1 raised the concern that users may accidentally hit
debug
commands when trying to evaluate variables with certain names. I then talked to a few IRB users during RubyConf and some of them confirmed that this did happen to them before. So I think we should explore methods to avoid such confusion.Description
When user enters
irb:rdbg
session, they don't get the same hint that thedebug
gem provides, likeThis means that users may accidentally execute commands when they want to retrieve the value of a variable.
So this commit adds a Reline output modifier to add a simiar hint:
It is not exactly the same as
debug
's because in this case the importance is to help users distinguish between value evaluation and debugger command execution.