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()
>250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432