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

Support repeating debugger input by passing empty input to it #856

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Feb 1, 2024

When typing empty input in rdbg sessions, debug repeats the last repeatable input so users don't need to type step or next repeatedly. But currently irb:rdbg session doesn't support this as IRB ignores empty input completely.

This PR supports the behaviour by adding representation for empty input, and pass it to the debugger when in the irb:rdbg session. I also added a test to check the current empty input behaviour in normal IRB sessions is not changed.

Closes ruby/debug#1063

@st0012 st0012 added the enhancement New feature or request label Feb 1, 2024
@st0012 st0012 self-assigned this Feb 1, 2024
@st0012 st0012 force-pushed the support-repeating-debugger-input branch 2 times, most recently from d8f148d to 34c4cdc Compare February 1, 2024 19:18
@st0012 st0012 force-pushed the support-repeating-debugger-input branch 2 times, most recently from c1c617d to 99b760e Compare February 15, 2024 20:06
@st0012 st0012 requested a review from tompng February 15, 2024 20:06
Since `rdbg` accepts empty input to repeat the previous command, IRB
should take empty input in `irb:rdbg` sessions and pass them to the
debugger.

Currently, IRB simply ignores empty input and does nothing. This commit
creates `EmptyInput` to represent empty input so it can fit into the
current IRB's input processing flow in `Irb#eval_input`.
@st0012 st0012 force-pushed the support-repeating-debugger-input branch from 99b760e to 7e728a1 Compare February 16, 2024 15:52
@st0012 st0012 merged commit 0e9db41 into master Feb 16, 2024
57 checks passed
@st0012 st0012 deleted the support-repeating-debugger-input branch February 16, 2024 16:12
matzbot pushed a commit to ruby/ruby that referenced this pull request Feb 16, 2024
to it
(ruby/irb#856)

* Test IRB's behaviour with empty input

* Handle empty input and pass it to debugger

Since `rdbg` accepts empty input to repeat the previous command, IRB
should take empty input in `irb:rdbg` sessions and pass them to the
debugger.

Currently, IRB simply ignores empty input and does nothing. This commit
creates `EmptyInput` to represent empty input so it can fit into the
current IRB's input processing flow in `Irb#eval_input`.

ruby/irb@0e9db419be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

<enter> does not repeat last command in irb_console mode.
2 participants