Skip to content

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

Merged
st0012 merged 2 commits into
masterfrom
support-repeating-debugger-input
Feb 16, 2024
Merged

st0012 merged 2 commits into
masterfrom
support-repeating-debugger-input

Conversation

@st0012

@st0012 st0012 commented Feb 1, 2024

Copy link
Copy Markdown
Member

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
Comment thread test/irb/test_debugger_integration.rb Outdated
@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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants