mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 10:42:02 +00:00
improve window title grabbing.
This commit is contained in:
parent
797feb6ab1
commit
d64e5f04ff
@ -307,11 +307,14 @@ Program.prototype.term = function(is) {
|
|||||||
|
|
||||||
Program.prototype.listen = function() {
|
Program.prototype.listen = function() {
|
||||||
// Potentially reset window title on exit:
|
// Potentially reset window title on exit:
|
||||||
// this.setTitleModeFeature(3);
|
// var self = this;
|
||||||
// this.manipulateWindow(21, function(err, data) {
|
// if (!this.isRxvt) {
|
||||||
// if (err) return;
|
// if (!this.isVTE) this.setTitleModeFeature(3);
|
||||||
// self._originalTitle = data.text;
|
// this.manipulateWindow(21, function(err, data) {
|
||||||
// });
|
// if (err) return;
|
||||||
|
// self._originalTitle = data.text;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
// Listen for keys/mouse on input
|
// Listen for keys/mouse on input
|
||||||
if (!this.input._blessedListened) {
|
if (!this.input._blessedListened) {
|
||||||
@ -1332,6 +1335,21 @@ Program.prototype._bindResponse = function(s) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rxvt-unicode does not support window manipulation
|
||||||
|
// Result Normal: OSC l/L 0xEF 0xBF 0xBD
|
||||||
|
// Result ASCII: OSC l/L 0x1c (file separator)
|
||||||
|
// Result UTF8->ASCII: OSC l/L 0xFD
|
||||||
|
// Test with:
|
||||||
|
// echo -ne '\ePtmux;\e\e[>3t\e\\'
|
||||||
|
// sleep 2 && echo -ne '\ePtmux;\e\e[21t\e\\' & cat -v
|
||||||
|
// -
|
||||||
|
// echo -ne '\e[>3t'
|
||||||
|
// sleep 2 && echo -ne '\e[21t' & cat -v
|
||||||
|
if (parts = /^\x1b\](l|L)([^\x07\x1b]*)$/.exec(s)) {
|
||||||
|
parts[2] = 'rxvt';
|
||||||
|
s = '\x1b]' + parts[1] + parts[2] + '\x1b\\';
|
||||||
|
}
|
||||||
|
|
||||||
// CSI Ps ; Ps ; Ps t
|
// CSI Ps ; Ps ; Ps t
|
||||||
// Window manipulation (from dtterm, as well as extensions).
|
// Window manipulation (from dtterm, as well as extensions).
|
||||||
// These controls may be disabled using the allowWindowOps
|
// These controls may be disabled using the allowWindowOps
|
||||||
@ -3840,8 +3858,9 @@ Program.prototype.reverseAttrInRectangle = function(params) {
|
|||||||
// Ps = 2 -> Set window/icon labels using UTF-8.
|
// Ps = 2 -> Set window/icon labels using UTF-8.
|
||||||
// Ps = 3 -> Query window/icon labels using UTF-8. (See dis-
|
// Ps = 3 -> Query window/icon labels using UTF-8. (See dis-
|
||||||
// cussion of "Title Modes")
|
// cussion of "Title Modes")
|
||||||
|
// XXX VTE bizarelly echos this:
|
||||||
Program.prototype.setTitleModeFeature = function(params) {
|
Program.prototype.setTitleModeFeature = function(params) {
|
||||||
return this._write('\x1b[>' + slice.call(arguments).join(';') + 't');
|
return this._twrite('\x1b[>' + slice.call(arguments).join(';') + 't');
|
||||||
};
|
};
|
||||||
|
|
||||||
// CSI Ps SP t
|
// CSI Ps SP t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user