Skip to content

Commit

Permalink
update terminal::geometry #995
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 22, 2025
1 parent 1f126ac commit abc3abb
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
6 changes: 5 additions & 1 deletion __tests__/__snapshots__/terminal.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ exports[` 1`] = `
"density": 1,
"rows": 25,
"terminal": {
"content": {
"height": 0,
"width": 0,
},
"height": 0,
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0,
},
"width": 0,
"width": 800,
},
}
`;
Expand Down
13 changes: 9 additions & 4 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -9785,7 +9785,6 @@
// ---------------------------------------------------------------------
function get_scrollbar_width() {
var width = filler.outerWidth();
var container_width = self.width();
return container_width - width;
}
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -10436,6 +10435,7 @@
// -------------------------------------------------------------
geometry: function() {
var padding = get_padding();
var height = old_height + padding.top + padding.bottom;
return {
terminal: {
padding: {
Expand All @@ -10444,8 +10444,12 @@
top: padding.top,
bottom: padding.bottom
},
width: old_width + padding.left + padding.right,
height: old_height + padding.top + padding.bottom
content: {
width: old_width + padding.left + padding.right,
height: height
},
width: container_width,
height: height
},
density: pixel_density,
char: char_size,
Expand Down Expand Up @@ -12114,7 +12118,7 @@
var in_login = false;// some Methods should not be called when login
// TODO: Try to use mutex like counter for pause/resume
var onPause = $.noop;// used to indicate that user call pause onInit
var old_width, old_height, old_pixel_density;
var old_width, old_height, old_pixel_density, container_width;
var delayed_commands = []; // used when exec commands while paused
var settings = $.extend(
{},
Expand Down Expand Up @@ -12751,6 +12755,7 @@
}
old_height = height;
old_width = width;
container_width = self.width();
old_pixel_density = pixel_density;
}
}
Expand Down
17 changes: 11 additions & 6 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Thu, 30 Jan 2025 13:12:50 +0000
* Date: Sat, 22 Feb 2025 14:31:01 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -5439,7 +5439,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Thu, 30 Jan 2025 13:12:50 +0000',
date: 'Sat, 22 Feb 2025 14:31:01 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9785,7 +9785,6 @@
// ---------------------------------------------------------------------
function get_scrollbar_width() {
var width = filler.outerWidth();
var container_width = self.width();
return container_width - width;
}
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -10436,6 +10435,7 @@
// -------------------------------------------------------------
geometry: function() {
var padding = get_padding();
var height = old_height + padding.top + padding.bottom;
return {
terminal: {
padding: {
Expand All @@ -10444,8 +10444,12 @@
top: padding.top,
bottom: padding.bottom
},
width: old_width + padding.left + padding.right,
height: old_height + padding.top + padding.bottom
content: {
width: old_width + padding.left + padding.right,
height: height
},
width: container_width,
height: height
},
density: pixel_density,
char: char_size,
Expand Down Expand Up @@ -12114,7 +12118,7 @@
var in_login = false;// some Methods should not be called when login
// TODO: Try to use mutex like counter for pause/resume
var onPause = $.noop;// used to indicate that user call pause onInit
var old_width, old_height, old_pixel_density;
var old_width, old_height, old_pixel_density, container_width;
var delayed_commands = []; // used when exec commands while paused
var settings = $.extend(
{},
Expand Down Expand Up @@ -12751,6 +12755,7 @@
}
old_height = height;
old_width = width;
container_width = self.width();
old_pixel_density = pixel_density;
}
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit abc3abb

Please sign in to comment.