diff options
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index a36fdbf3..a11b0f29 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3503,11 +3503,13 @@ class Cmd(cmd.Cmd): if rl_type != RlType.NONE: last = None for item in history: - # readline only adds a single entry for multiple sequential identical commands - # so we emulate that behavior here - if item.raw != last: - readline.add_history(item.raw) - last = item.raw + # Break the command into its individual lines + for line in item.raw.splitlines(): + # readline only adds a single entry for multiple sequential identical lines + # so we emulate that behavior here + if line != last: + readline.add_history(line) + last = line # register a function to write history at save # if the history file is in plain text format from 0.9.12 or lower |