mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 19:44:35 +08:00
update files
This commit is contained in:
parent
e90d05c1bc
commit
abaea8ed18
@ -121,17 +121,17 @@ module.exports = function (Terminal){
|
||||
|
||||
switch (ch) {
|
||||
case '&':
|
||||
out += '&';
|
||||
out += '&';
|
||||
break;
|
||||
case '<':
|
||||
out += '<';
|
||||
out += '<';
|
||||
break;
|
||||
case '>':
|
||||
out += '>';
|
||||
break;
|
||||
default:
|
||||
if (ch <= ' ') {
|
||||
out += ' ';
|
||||
out += '>';
|
||||
} else {
|
||||
if (this.isWide(ch)) i++;
|
||||
|
||||
|
@ -13,6 +13,8 @@ module.exports = function (Terminal){
|
||||
this.lines = this.lines.slice(-(this.ybase + this.rows) + 1);
|
||||
}
|
||||
|
||||
console.log(this.ybase, this.scrollback);
|
||||
|
||||
this.ydisp = this.ybase;
|
||||
|
||||
// last line
|
||||
|
@ -10,30 +10,6 @@ function fixLinefeed(data){
|
||||
return data.replace(/([^\r])\n/g, '$1\r\n');
|
||||
}
|
||||
|
||||
function fixIndent(data){
|
||||
if (!/(^|\n) /.test(data)) return data;
|
||||
|
||||
// not very efficient, but works and would only become a problem
|
||||
// once we render huge amounts of data
|
||||
return data
|
||||
.split('\n')
|
||||
.map(function (line){
|
||||
var count = 0;
|
||||
|
||||
while (line.charAt(0) === ' ') {
|
||||
line = line.slice(1);
|
||||
count++;
|
||||
}
|
||||
|
||||
while (count--) {
|
||||
line = ' ' + line;
|
||||
}
|
||||
|
||||
return line;
|
||||
})
|
||||
.join('\r\n');
|
||||
}
|
||||
|
||||
module.exports = function (Terminal){
|
||||
Terminal.prototype.bell = function (){
|
||||
var snd = new Audio('bell.wav'); // buffers automatically when created
|
||||
@ -55,7 +31,6 @@ module.exports = function (Terminal){
|
||||
|
||||
Terminal.prototype.write = function (data){
|
||||
data = fixLinefeed(data);
|
||||
data = fixIndent(data);
|
||||
|
||||
var l = data.length;
|
||||
var i = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user