diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2016-12-15 22:05:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-15 22:05:30 +0000 |
commit | ac5e05a515aa6a3b27ed23ce89840b15b900ce33 (patch) | |
tree | 4eb940772d132f378ca81ec235227554817d5386 /alot/commands | |
parent | d633feddaf77c171aafe1586a6306c4ba67d29d6 (diff) | |
parent | 72baf0229ffdebfe2fcd71c82301885fda89db8b (diff) |
Merge pull request #885 from lucc/history
Save command line history across sessions
Diffstat (limited to 'alot/commands')
-rw-r--r-- | alot/commands/globals.py | 12 | ||||
-rw-r--r-- | alot/commands/thread.py | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 437b3644..d2d0285c 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -52,6 +52,7 @@ class ExitCommand(Command): for b in ui.buffers: b.cleanup() ui.apply_command(FlushCommand(callback=ui.exit)) + ui.cleanup() if ui.db_was_locked: msg = 'Database locked. Exit without saving?' @@ -765,10 +766,11 @@ class ComposeCommand(Command): else: cmpl = AccountCompleter() fromaddress = yield ui.prompt('From', completer=cmpl, - tab=1) + tab=1, history=ui.senderhistory) if fromaddress is None: raise CommandCanceled() + ui.senderhistory.append(fromaddress) self.envelope.add('From', fromaddress) # find out the right account @@ -820,12 +822,14 @@ class ComposeCommand(Command): append_remaining=allbooks) logging.debug(abooks) completer = ContactsCompleter(abooks) - to = yield ui.prompt('To', - completer=completer) + to = yield ui.prompt('To', completer=completer, + history=ui.recipienthistory) if to is None: raise CommandCanceled() - self.envelope.add('To', to.strip(' \t\n,')) + to = to.strip(' \t\n,') + ui.recipienthistory.append(to) + self.envelope.add('To', to) if settings.get('ask_subject') and \ 'Subject' not in self.envelope.headers: diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 00ac3f45..4b2221de 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -436,7 +436,8 @@ class BounceMailCommand(Command): completer = ContactsCompleter(abooks) else: completer = None - to = yield ui.prompt('To', completer=completer) + to = yield ui.prompt('To', completer=completer, + history=ui.recipienthistory) if to is None: raise CommandCanceled() |