mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-10 19:16:20 +00:00
helpers
This commit is contained in:
parent
48d7d73116
commit
7b067f2e65
@ -35,6 +35,8 @@ function Program(input, output) {
|
|||||||
this.terminal = process.env.TERM || 'xterm';
|
this.terminal = process.env.TERM || 'xterm';
|
||||||
|
|
||||||
this.listen();
|
this.listen();
|
||||||
|
|
||||||
|
Program.global = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.prototype.__proto__ = EventEmitter.prototype;
|
Program.prototype.__proto__ = EventEmitter.prototype;
|
||||||
@ -540,7 +542,7 @@ Program.prototype._bindResponse = function(s) {
|
|||||||
// OSC L label ST
|
// OSC L label ST
|
||||||
// Ps = 2 1 -> Report xterm window's title. Result is OSC l
|
// Ps = 2 1 -> Report xterm window's title. Result is OSC l
|
||||||
// label ST
|
// label ST
|
||||||
if (parts = /^\x1b\](l|L)([^\x07\x1b]*)(?:\x07|\\\x1b)/.exec(s)) {
|
if (parts = /^\x1b\](l|L)([^\x07\x1b]*)(?:\x07|\x1b\\)/.exec(s)) {
|
||||||
if (parts[1] === 'L') {
|
if (parts[1] === 'L') {
|
||||||
return this.emit('response', {
|
return this.emit('response', {
|
||||||
windowIconLabel: parts[2]
|
windowIconLabel: parts[2]
|
||||||
@ -658,6 +660,15 @@ Program.prototype.rmove = function(x, y) {
|
|||||||
this.rsetY(y);
|
this.rsetY(y);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Program.prototype.simpleInsert = function(ch, i, attr) {
|
||||||
|
return this.write(this.repeat(ch, i), attr);
|
||||||
|
};
|
||||||
|
|
||||||
|
Program.prototype.repeat = function(ch, i) {
|
||||||
|
if (!(i >= 0)) i = 0;
|
||||||
|
return Array(i + 1).join(ch);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normal
|
* Normal
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user