summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-31 06:42:58 +0200
committerhut <hut@lavabit.com>2010-03-31 06:42:58 +0200
commitc325316f5b1e870a592753178206ad8868b30653 (patch)
treeb58c2f320acedae0c62bf1b5f1f9752ea5a7b707 /ranger
parente2b8008ab1ea1d1d69dcb348f36ba3c28ef2cc6a (diff)
downloadranger-c325316f5b1e870a592753178206ad8868b30653.tar.gz
Abort loading operations when pressing ^C rather than quitting
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/keys.py10
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))