-
-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alignment with \t #423
Comments
jcubic
added a commit
that referenced
this issue
Aug 25, 2018
The feature is in devel branch, but you can update it in your current version using: $.terminal.encode = function encode(str, options) {
var settings = $.extend({
tabs: 4
}, options);
return $.terminal.amp(str).replace(/</g, '<').replace(/>/g, '>')
.replace(/ /g, ' ').split('\n').map(function(line) {
var splitted = line.split(/(\t)/);
return splitted.map(function(str, i) {
if (str === '\t') {
if (i === 0 || splitted[i - 1] === '\t') {
return new Array(settings.tabs + 1).join(' ');
} else {
var before = splitted.slice(0, i).join('');
var len = $.terminal.length(before);
var chars = settings.tabs - (len % settings.tabs);
if (chars === 0) {
chars = 4;
}
return new Array(chars + 1).join(' ');
}
}
return str;
}).join('');
}).join('\n');
}; |
jcubic
added a commit
that referenced
this issue
Aug 25, 2018
Now tabs option actually work (previously it only worked with columns and echo array) you can specify 8 to get the same results as in unix terminal. |
Version 1.21.0 released. |
there was still issues with tabs in command it's now fixed and it will be in next version. |
version 1.22.0 released |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
\t aligns the text one below each in case of unix output but this is not the case in jquery terminal
String : Test 0.\n\n==============================\nStatus1.\t[ ]\b\b\b\b\b--\r\u001B[KStatus1.\t[ ]\b\b\b\b\bDONE\nLine2.\t[ ]\b\b\b\b\b----\b\b\b\b \b\b\b\b----\b\b\b\b \b\b\b\b----\b\b\b\b \b\b\b\b----\b\b\b\b \b\b\b\b----\b\b\b\b \b\b\b\b----\b\b\b\b \b\b\b\b----\b\b\b\b \b\b\b\b-\r\u001B[KLin2.\t[ ]\b\b\b\b\bFAIL\nTest3.\t[ ]\b\b\b\b\b--\r\u001B[KTest3.\t[ ]\b\b\b\b\bWARNING]\n\nFinal status\n\nStatus details\nTime: 11
Expected behavior
(all the '[' are aligned one below the other)
Actual behavior
The text was updated successfully, but these errors were encountered: