Made it so vterm stops auto scrolling if user interrupts.

This commit is contained in:
Andrew 2021-08-21 16:17:35 -04:00
parent 35047e062a
commit 6ecf6285b9
2 changed files with 6 additions and 2 deletions

View File

@ -292,7 +292,7 @@ $( document ).ready(function() {
location.reload()
});
}
if (webSocket) {
webSocket.on('update_button_status', function (updateButton) {
var id = 'controls';

View File

@ -151,9 +151,13 @@
});
}
function new_line_handler(data) {
$('#virt_console').append(data.line)
if (!$("#stop_scroll").is(':checked')) {
const elem = document.getElementById('virt_console');
const scrollDiff = (elem.scrollHeight - elem.scrollTop) - elem.clientHeight;
if (!$("#stop_scroll").is(':checked') && scrollDiff < 450) {
scrollConsole()
}
}