]> git.cworth.org Git - sup/commitdiff
only set terminal title if $TERM is an xterm or rxvt variant
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 9 Jan 2008 16:06:39 +0000 (08:06 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 9 Jan 2008 16:06:39 +0000 (08:06 -0800)
lib/sup/buffer.rb

index fa1afe623592aeadf26e985186967bb2c2b91f91..782695b7655c2f64beb0249a3671bc13afe2ff11 100644 (file)
@@ -63,6 +63,7 @@ class Buffer
     @title = opts[:title] || ""
     @force_to_top = opts[:force_to_top] || false
     @x, @y, @width, @height = 0, 0, width, height
+    @in_x = ENV["TERM"] =~ /(xterm|rxvt)/
   end
 
   def content_height; @height - 1; end
@@ -262,7 +263,7 @@ EOS
         get_status_and_title @focus_buf # must be called outside of the ncurses lock
       end
 
-    print "\033]2;#{title}\07" if title
+    print "\033]2;#{title}\07" if title && @in_x
 
     Ncurses.mutex.lock unless opts[:sync] == false