close
Skip to content

Quick exit command #6

@st0012

Description

@st0012

Currently, all exit/quit/kill commands require an additional confirmation step.

debug/lib/debug/session.rb

Lines 236 to 251 in 4a3046b

when 'q', 'quit', 'exit'
if ask 'Really quit?'
@ui.quit arg.to_i
@tc << :continue
else
return :retry
end
# * `kill` or `q[uit]!`
# * Stop the debuggee process.
when 'kill', 'quit!', 'q!'
if ask 'Really kill?'
exit! (arg || 1).to_i
else
return :retry
end

❯ rdbg foo.rb
[1, 2] in foo.rb
=>    1| a = 1
      2| puts(a)
--> #0  foo.rb:1:in `<main>'

(rdbg) exit
Really quit? [Y/n] Y
❯ rdbg foo.rb
[1, 2] in foo.rb
=>    1| a = 1
      2| puts(a)
--> #0  foo.rb:1:in `<main>'

(rdbg) quit!
Really kill? [Y/n] Y

Without changing any existing commands, I wonder if it's ok to add the exit! command? It'll allow users to quickly exit the current session without hitting Y to confirm it.

❯ exe/rdbg foo.rb
[1, 1] in foo.rb
=>    1| puts(1)
=>#0    <main> at foo.rb:1

(rdbg) exit!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions