-
Notifications
You must be signed in to change notification settings - Fork 336
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
How to add scrollbar? #45
Comments
the scroll can be done by ctrl+arrow up arrow down, or just use your middle scroll mouse to scroll. |
Also, would really love to see a scrollbar. Is this feasible? |
Part of why a scrollbar would be nice is scrolling in other ways is really sensitive. So, I will skip past the interesting section. Plus, the other reasons scrollbars are nice. |
+1 I can probably implement the scrollbar feature (using this.ydisp & this.ybase as scroll bar position / height etc..?) but the author of this project doesn't seem to be accepting pull-request.. Maybe I should work on jeremyramin/term.js branch instead? |
I did it using jQueryUI. <div id="terminal-outbox">
<div class="terminal-container">Loading Terminal...</div>
</div>
<div id="scroller"></div> The CSS put the ...
var div = $('.terminal-container').empty()[0];
term.open(div);
var scroller = $('#scroller').slider({
orientation: 'vertical',
value: -term.ydisp,
min: -term.ybase,
max: 0,
step: 1,
slide: function(event, ui) {
console.log(term.ybase, ui.value, term.ydisp);
term.scrollDisp(-ui.value - term.ydisp);
}
});
function updateScroller() {
scroller.slider('option', 'min', -term.ybase);
scroller.slider('option', 'value', -term.ydisp);
}
...
socket.on('data', function(data) {
if (data.termData != null) {
term.write(data.termData);
updateTitle();
updateScroller();
}
});
... Simple as piece of cake. :-) |
Is there a way to do something similar using just the native browser scrollbar? Maybe by overlaying another transparent div on top of the term window? |
Sure @soichih! I like the themeable jQuery scroll, but i would like to see a native scrollbar approach. |
I believe this is implemented in the butterfly project -- https://github.com/paradoxxxzero/butterfly/blob/master/coffees/term.coffee |
I think some of the users of this project appreciate the permissive licensing of this project. So, it is doubtful they will want to switch to a GPL'd project. |
Did anyone manage to implement HTML5 only scrollbar for this? I can't think of a way to display just the scrollbar without creating a narrow div (with scroll: auto) next to the term. |
This project is no longer maintained |
xterm.js does support colors. I just had to add |
How can I add a scroll bar? Currently when I scroll it with mouse wheel it is okay, but I think it changes the dom to do so by having the exact number of divs as height, and modifying its content on mousewheel.
There is
Terminal.prototype.bindMouse = function() {
, by looking its context all I see it sends some characters but I am not sure. Any thoughts on this? I can at least bind two buttons, one up and down for emulating that mouse movement one by one.The text was updated successfully, but these errors were encountered: