summary refs log tree commit diff stats
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
parente2b8008ab1ea1d1d69dcb348f36ba3c28ef2cc6a (diff)
downloadranger-c325316f5b1e870a592753178206ad8868b30653.tar.gz
Abort loading operations when pressing ^C rather than quitting
-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))
ger/commit/test/tc_signal.py?h=v1.9.1&id=d1fc886688016e97af8f1dbe74e5b2c04649e08b'>d1fc8866 ^
1c1b6c31 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133