summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-09 10:44:02 +0100
committerhut <hut@lavabit.com>2010-02-09 10:49:14 +0100
commit6a8d5d23fae4566106ef4c1efca18c35f447df3a (patch)
treec0ce9d327422cef7388c476b49ca6761a1fe7071
parentaea5cf928e2fdeef04315408229fedbb4e2fc977 (diff)
downloadranger-6a8d5d23fae4566106ef4c1efca18c35f447df3a.tar.gz
implemented #58: update terminal title
-rw-r--r--TODO2
-rw-r--r--ranger/defaults/options.py1
-rw-r--r--ranger/gui/ui.py3
-rw-r--r--ranger/shared/settings.py2
4 files changed, 6 insertions, 2 deletions
diff --git a/TODO b/TODO
index 86ffdec7..fb0f01d4 100644
--- a/TODO
+++ b/TODO
@@ -41,7 +41,7 @@ General
    ( ) #55  10/01/24  allow change of filename when pasting
    ( ) #56  10/01/30  warn before deleting mount points
    ( ) #57  10/01/30  warn before deleting unseen marked files
-   ( ) #58  10/02/04  change the title of the terminal
+   (X) #58  10/02/04  change the title of the terminal
 
 
 Bugs
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index cb4d90f7..0b57b259 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -21,5 +21,6 @@ directories_first = True
 show_hidden = False
 collapse_preview = True
 autosave_bookmarks = True
+update_title = True
 
 hidden_filter = regexp(r'^\.|~$|\.(:?pyc|pyo|bak|swp)$')
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index a8353c7d..61a64fc2 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -12,6 +12,7 @@
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+import sys
 import curses
 import _curses
 
@@ -183,6 +184,8 @@ class UI(DisplayableContainer):
 		"""Erase the window, then draw all objects in the container"""
 		self.win.touchwin()
 		DisplayableContainer.draw(self)
+		if self.settings.update_title:
+			sys.stdout.write("\033]2;atom" + self.fm.env.pwd.path + "\007")
 		self.win.refresh()
 
 	def finalize(self):
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py
index 2a86e052..3d634652 100644
--- a/ranger/shared/settings.py
+++ b/ranger/shared/settings.py
@@ -16,7 +16,7 @@ ALLOWED_SETTINGS = """
 show_hidden scroll_offset
 directories_first sort reverse
 preview_files max_history_size colorscheme
-collapse_preview
+collapse_preview update_title
 hidden_filter flushinput
 max_dirsize_for_autopreview autosave_bookmarks
 """.split()
cc813408772738fc124130095ba4a5c33c84dea3'>^
f07bb12f ^








62cd83ba ^






































































c776804d ^
62cd83ba ^
c776804d ^
62cd83ba ^

f07bb12f ^

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
134
135
136
137
138
139
140
141
142
143
144