window title. potential enter/return fix for keys.
This commit is contained in:
parent
0881128a4f
commit
547812928e
10
lib/keys.js
10
lib/keys.js
|
@ -126,6 +126,8 @@ function emitKey(stream, s) {
|
|||
} else if (s === '\n') {
|
||||
// enter, should have been called linefeed
|
||||
key.name = 'enter';
|
||||
// linefeed
|
||||
// key.name = 'linefeed';
|
||||
|
||||
} else if (s === '\t') {
|
||||
// tab
|
||||
|
@ -298,5 +300,13 @@ function emitKey(stream, s) {
|
|||
|
||||
if (key || ch) {
|
||||
stream.emit('keypress', ch, key);
|
||||
// if (key && key.name === 'return') {
|
||||
// var nkey = {};
|
||||
// Object.keys(key).forEach(function(k) {
|
||||
// nkey[k] = key[k];
|
||||
// });
|
||||
// nkey.name = 'enter';
|
||||
// stream.emit('keypress', ch, nkey);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1387,6 +1387,15 @@ Program.prototype.repeat = function(ch, i) {
|
|||
return Array(i + 1).join(ch);
|
||||
};
|
||||
|
||||
Program.prototype.__defineGetter__('title', function() {
|
||||
return this._title;
|
||||
});
|
||||
|
||||
Program.prototype.__defineSetter__('title', function(title) {
|
||||
this.setTitle(title);
|
||||
return this._title;
|
||||
});
|
||||
|
||||
/**
|
||||
* Normal
|
||||
*/
|
||||
|
@ -1721,14 +1730,6 @@ Program.prototype.setTitle = function(title) {
|
|||
return this._write('\x1b]0;' + title + '\x07');
|
||||
};
|
||||
|
||||
Program.prototype.__defineGetter__('title', function() {
|
||||
return this._title;
|
||||
});
|
||||
|
||||
Program.prototype.__defineSetter__('title', function(title) {
|
||||
return this.setTitle(title);
|
||||
});
|
||||
|
||||
// OSC Ps ; Pt ST
|
||||
// OSC Ps ; Pt BEL
|
||||
// Reset colors
|
||||
|
|
|
@ -2,7 +2,8 @@ var blessed = require('../')
|
|||
, screen;
|
||||
|
||||
screen = blessed.screen({
|
||||
dump: __dirname + '/logs/widget.log'
|
||||
dump: __dirname + '/logs/widget.log',
|
||||
title: 'widget test'
|
||||
});
|
||||
|
||||
screen.append(blessed.text({
|
||||
|
|
Loading…
Reference in New Issue