diff --git a/lib/program.js b/lib/program.js index d21a84b..6a8473d 100644 --- a/lib/program.js +++ b/lib/program.js @@ -970,6 +970,13 @@ Program.prototype.osc = function(code) { // OSC Ps ; Pt BEL // Set Text Parameters. Program.prototype.setTitle = function(title) { + if (this.term('screen')) { + // Tmux pane + // if (process.env.TMUX) { + // return this.osc('2;' + title + '\x1b\\'); + // } + return this.esc('k' + title + '\x1b\\'); + } return this.osc('0;' + title + '\x07'); }; diff --git a/lib/tput.js b/lib/tput.js index fd21bb5..40b8367 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -10,6 +10,13 @@ // http://invisible-island.net/ncurses/man/term.5.html // https://en.wikipedia.org/wiki/Terminfo +// Todo: +// - xterm's XT (set-title capability?) value should +// be true (at least tmux thinks it should). +// It's not parsed as true. Investigate. +// - Possibly switch to other method of finding the +// extended data string table: i += h.symOffsetCount * 2; + /** * Modules */