diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-17 17:29:38 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-17 17:29:38 -0400 |
| commit | d745c773cbb1a135cc30875736ef21cc629f3985 (patch) | |
| tree | 9309e03b835390b5e68a7217dbd42993c9f41d7f /cmd2 | |
| parent | b0116dce61dc12207fa96c6a53d05d2301a9fe7a (diff) | |
| parent | ab5a11c4e355248545c392682f378d2652ecf999 (diff) | |
| download | cmd2-git-d745c773cbb1a135cc30875736ef21cc629f3985.tar.gz | |
Merge branch 'master' into multi-completion
Diffstat (limited to 'cmd2')
| -rw-r--r-- | cmd2/cmd2.py | 2 | ||||
| -rw-r--r-- | cmd2/history.py | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 7a9245ab..2bec27d1 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2221,7 +2221,7 @@ class Cmd(cmd.Cmd): else: line = 'eof' - return line.strip() + return line.rstrip('\r\n') def _cmdloop(self) -> None: """Repeatedly issue a prompt, accept input, parse an initial prefix diff --git a/cmd2/history.py b/cmd2/history.py index dbc9a3a4..576ac37d 100644 --- a/cmd2/history.py +++ b/cmd2/history.py @@ -44,9 +44,12 @@ class HistoryItem(): :return: pretty print string version of a HistoryItem """ if verbose: - ret_str = self._listformat.format(self.idx, self.raw.rstrip()) - if self.raw != self.expanded.rstrip(): - ret_str += '\n' + self._ex_listformat.format(self.idx, self.expanded.rstrip()) + raw = self.raw.rstrip() + expanded = self.expanded.rstrip() + + ret_str = self._listformat.format(self.idx, raw) + if raw != expanded: + ret_str += '\n' + self._ex_listformat.format(self.idx, expanded) else: if expanded: ret_str = self.expanded.rstrip() |
