Skip to content
Browse files

fix inverse. log and error functions. fix title setting.

  • Loading branch information...
1 parent 11f2e16 commit 89a95a0964b2a74462528616cfcf64c599bb5f29 @chjj committed Apr 4, 2012
Showing with 21 additions and 9 deletions.
  1. +12 −4 static/term.js
  2. +9 −5 static/tty.js
View
16 static/term.js
@@ -31,6 +31,12 @@
'use strict';
/**
+ * Shared
+ */
+
+var window = this;
+
+/**
* States
*/
@@ -1780,16 +1786,18 @@ Terminal.prototype.bell = function() {
if (Terminal.popOnBell) this.focus();
};
-Terminal.prototype.log = function(data) {
+Terminal.prototype.log = function() {
if (!Terminal.debug) return;
if (!window.console || !window.console.log) return;
- window.console.log(data);
+ var args = Array.prototype.slice.call(arguments);
+ window.console.log.apply(window.console, args);
};
-Terminal.prototype.error = function(data) {
+Terminal.prototype.error = function() {
if (!Terminal.debug) return;
if (!window.console || !window.console.error) return;
- window.console.error(data);
+ var args = Array.prototype.slice.call(arguments);
+ window.console.error.apply(window.console, args);
};
Terminal.prototype.resize = function(x, y) {
View
14 static/tty.js
@@ -483,13 +483,17 @@ Tab.prototype.handleTitle = function(title) {
if (!title) return;
title = sanitize(title);
- document.title = title;
- this.window.bar.title = title;
-
this.title = title;
- // this.setProcessName(this.process);
- // if (h1) h1.innerHTML = title;
+ if (Terminal.focus === this) {
+ document.title = title;
+ // if (h1) h1.innerHTML = title;
+ }
+
+ if (this.window.focused === this) {
+ this.window.bar.title = title;
+ // this.setProcessName(this.process);
+ }
};
Tab.prototype._write = Tab.prototype.write;

0 comments on commit 89a95a0

Please sign in to comment.
Something went wrong with that request. Please try again.