-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset history counter even when @loaded_history_lines is not defined
The issue (https://github.com/ruby/debug/issues/1064) is caused by a combination of factors: 1. When user starts an IRB session without a history file, the `@loaded_history_lines` ivar is not defined. 2. If the user then starts the `irb:rdbg` session, the history counter is not set, because the `@loaded_history_lines` is not defined. 3. Because `irb:rdbg` saves the history before passing Ruby expression to the debugger, it saves the history with duplicated lines. The number grows in exponential order. 4. When the user exits the `irb:rdbg` session, the history file could be bloated with duplicated lines. This commit fixes the issue by resetting the history counter even when `@loaded_history_lines` is not defined.
- Loading branch information
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
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
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