Skip to content

Commit

Permalink
Mention IRB as the console in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 authored and ko1 committed Mar 29, 2024
1 parent ffbdb30 commit a655f10
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,30 @@ The `<...>` notation means the argument.
* Show help for the given command.


### Using IRB as the Debug Console

Starting from version `v1.9`, you can now use IRB as the debug console. This integration brings additional features such as:

* Autocompletion
* Support for multi-line input
* Access to commands not available in `debug`, like `show_source` or `show_doc`
* [Configurable command aliases](https://docs.ruby-lang.org/en/master/IRB.html#module-IRB-label-Command+Aliases)

To switch to the IRB console, simply use the `irb` command in the debug console.

Once activated, you'll notice the prompt changes to:

```txt
irb:rdbg(main):001>
```

If you want to make IRB the default console for all sessions, configure the `irb_console` setting by either:

* Setting the `RUBY_DEBUG_IRB_CONSOLE=true` environment variable
* Or adding `config set irb_console 1` to your `~/.rdbgrc`

To disable the IRB console in the current session, execute `config set irb_console 0` in the console.

## Debugger API

### Start debugging
Expand Down
24 changes: 24 additions & 0 deletions misc/README.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,30 @@ The `<...>` notation means the argument.

<%= DEBUGGER__.help %>

### Using IRB as the Debug Console

Starting from version `v1.9`, you can now use IRB as the debug console. This integration brings additional features such as:

* Autocompletion
* Support for multi-line input
* Access to commands not available in `debug`, like `show_source` or `show_doc`
* [Configurable command aliases](https://docs.ruby-lang.org/en/master/IRB.html#module-IRB-label-Command+Aliases)

To switch to the IRB console, simply use the `irb` command in the debug console.

Once activated, you'll notice the prompt changes to:

```txt
irb:rdbg(main):001>
```

If you want to make IRB the default console for all sessions, configure the `irb_console` setting by either:

* Setting the `RUBY_DEBUG_IRB_CONSOLE=true` environment variable
* Or adding `config set irb_console 1` to your `~/.rdbgrc`

To disable the IRB console in the current session, execute `config set irb_console 0` in the console.

## Debugger API

### Start debugging
Expand Down

0 comments on commit a655f10

Please sign in to comment.