diff options
author | hut <hut@lavabit.com> | 2010-03-31 06:42:58 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-03-31 06:42:58 +0200 |
commit | c325316f5b1e870a592753178206ad8868b30653 (patch) | |
tree | b58c2f320acedae0c62bf1b5f1f9752ea5a7b707 /ranger | |
parent | e2b8008ab1ea1d1d69dcb348f36ba3c28ef2cc6a (diff) | |
download | ranger-c325316f5b1e870a592753178206ad8868b30653.tar.gz |
Abort loading operations when pressing ^C rather than quitting
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/defaults/keys.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py index c9afbc00..eed77db4 100644 --- a/ranger/defaults/keys.py +++ b/ranger/defaults/keys.py @@ -195,7 +195,15 @@ def initialize_commands(map): map('ZZ', 'ZQ', fm.exit()) map(ctrl('R'), fm.reset()) map('R', fm.reload_cwd()) - map(ctrl('C'), fm.exit()) + @map(ctrl('C')) + def ctrl_c(arg): + try: + item = arg.fm.loader.queue[0] + except: + arg.fm.notify("Type Q or :quit<Enter> to exit Ranger") + else: + arg.fm.notify("Aborting: " + item.get_description()) + arg.fm.loader.remove(index=0) map(':', ';', fm.open_console(cmode.COMMAND)) map('>', fm.open_console(cmode.COMMAND_QUICK)) |