@volter/supercode-teams 0.2.80 → 0.2.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/terminal-look.mjs +25 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.81",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
|
|
6
6
|
"license": "MIT",
|
package/terminal-look.mjs
CHANGED
|
@@ -45,7 +45,7 @@ function run() {
|
|
|
45
45
|
const font = archived('Font');
|
|
46
46
|
return JSON.stringify({
|
|
47
47
|
name, colors,
|
|
48
|
-
font: font && !font.isNil() ? { family: ObjC.unwrap(font.familyName), size: font.pointSize,
|
|
48
|
+
font: font && !font.isNil() ? { family: ObjC.unwrap(font.familyName), size: font.pointSize, advance: font.advancementForGlyph(font.glyphWithName('M')).width, ascender: font.ascender, descender: font.descender, leading: font.leading } : null,
|
|
49
49
|
widthSpacing: value('FontWidthSpacing'), heightSpacing: value('FontHeightSpacing'),
|
|
50
50
|
cursorType: value('CursorType'), cursorBlink: value('CursorBlink'), optionIsMeta: value('useOptionAsMetaKey'),
|
|
51
51
|
bell: value('Bell'), visualBell: value('VisualBell'), brightBold: value('UseBrightBold'),
|
|
@@ -85,11 +85,26 @@ export function weztermConfig(profile, { fontDirs = existsSync(TERMINAL_FONTS) ?
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
const table = (colors) => `{\n${Object.entries(colors).map(([key, value]) => ` ${key} = ${Array.isArray(value) ? `{ ${value.map(lua).join(', ')} }` : lua(value)},`).join('\n')}\n }`;
|
|
88
|
-
|
|
89
|
-
//
|
|
88
|
+
// Terminal.app's face drawn by CoreText is heavier than the same face drawn by WezTerm's FreeType: on the same Retina
|
|
89
|
+
// display, SF Mono Terminal 12 put 14432 of ink per cell in Terminal.app, 12043 at Medium and 15864 at DemiBold in
|
|
90
|
+
// WezTerm (Regular: 72%). DemiBold is the nearest; bold text takes the face's Bold in both (94%).
|
|
91
|
+
const primary = `{ family = ${lua(profile?.font?.family ?? 'SF Mono Terminal')}, weight = 'DemiBold' }`;
|
|
92
|
+
const families = mac ? [primary, ...MAC_CASCADE.map(lua)] : [];
|
|
93
|
+
// Terminal.app's cell is whole points: the advance rounded down (7 pt for SF Mono Terminal 12's 7.418) and the line
|
|
94
|
+
// (ascent + descent + leading) rounded up (15 pt for 14.32), measured as 14 x 30 px on a Retina display. WezTerm rounds
|
|
95
|
+
// its cell up to whole pixels before and after these factors, so the width factor is floor/ceil of the advance (14 px
|
|
96
|
+
// at 2x) and the height factor lands on the doubled line at 2x (30 px). Evidence stops at 2x: at 1x the same factors
|
|
97
|
+
// predict 7 x 16 px where Terminal.app draws 7 x 15.
|
|
90
98
|
const font = profile?.font;
|
|
91
|
-
const
|
|
92
|
-
const
|
|
99
|
+
const advance = (font?.advance ?? 0) * (profile?.widthSpacing ?? 1);
|
|
100
|
+
const cellWidth = advance > 0 ? Math.floor(advance) / Math.ceil(advance) : 1;
|
|
101
|
+
const height = font ? font.ascender - font.descender + (font.leading ?? 0) : 0;
|
|
102
|
+
const lineHeight = height > 0 ? (2 * Math.ceil(height) - 0.5) / Math.ceil(2 * height) : 1;
|
|
103
|
+
// Terminal.app's translucent, blurred ground at 0.95 rendered within 2 levels of the opaque colour; WezTerm's at 0.95
|
|
104
|
+
// rendered 8 levels lighter over the same desktop. So a nearly opaque profile is drawn opaque (below 0.9 the profile's
|
|
105
|
+
// opacity is kept: unmeasured).
|
|
106
|
+
const alpha = stored.BackgroundColor?.[3] ?? 1;
|
|
107
|
+
const opacity = alpha >= 0.9 ? 1 : alpha;
|
|
93
108
|
const cursorShape = ['Block', 'Underline', 'Bar'][profile?.cursorType ?? 0] ?? 'Block';
|
|
94
109
|
const composed = !profile?.optionIsMeta;
|
|
95
110
|
const lines = [
|
|
@@ -100,14 +115,14 @@ export function weztermConfig(profile, { fontDirs = existsSync(TERMINAL_FONTS) ?
|
|
|
100
115
|
"local appearance = wezterm.gui and wezterm.gui.get_appearance() or 'Dark'",
|
|
101
116
|
"config.colors = appearance:find('Dark') and schemes.dark or schemes.light",
|
|
102
117
|
`config.font_dirs = { ${fontDirs.map(lua).join(', ')} }`,
|
|
103
|
-
...(families.length ? [`config.font = wezterm.font_with_fallback({ ${families.
|
|
118
|
+
...(families.length ? [`config.font = wezterm.font_with_fallback({ ${families.join(', ')} })`] : []),
|
|
104
119
|
// CoreText draws glyphs unhinted; FreeType's default hinting snaps their outlines to the pixel grid.
|
|
105
120
|
"config.freetype_load_flags = 'NO_HINTING'",
|
|
106
121
|
// Box and block characters are the face's own glyphs, as CoreText draws them, not WezTerm's drawn lines.
|
|
107
122
|
'config.custom_block_glyphs = false',
|
|
108
123
|
`config.font_size = ${profile?.font?.size ?? TERMINAL_BASIC.fontSize}`,
|
|
109
|
-
`config.cell_width = ${
|
|
110
|
-
`config.line_height = ${Number(((profile?.heightSpacing ?? 1) *
|
|
124
|
+
`config.cell_width = ${Number(cellWidth.toFixed(4))}`,
|
|
125
|
+
`config.line_height = ${Number(((profile?.heightSpacing ?? 1) * lineHeight).toFixed(4))}`,
|
|
111
126
|
`config.default_cursor_style = ${lua(`${profile?.cursorBlink ? 'Blinking' : 'Steady'}${cursorShape}`)}`,
|
|
112
127
|
`config.send_composed_key_when_left_alt_is_pressed = ${composed}`,
|
|
113
128
|
`config.send_composed_key_when_right_alt_is_pressed = ${composed}`,
|
|
@@ -119,8 +134,8 @@ export function weztermConfig(profile, { fontDirs = existsSync(TERMINAL_FONTS) ?
|
|
|
119
134
|
`config.macos_window_background_blur = ${opacity < 1 ? Math.round((profile?.blur ?? 0) * 40) : 0}`,
|
|
120
135
|
`config.initial_cols = ${profile?.columns ?? 80}`,
|
|
121
136
|
`config.initial_rows = ${profile?.rows ?? 24}`,
|
|
122
|
-
// Terminal.app's
|
|
123
|
-
|
|
137
|
+
// Terminal.app's text starts 11 pt from the window's edge (22 px at 2x, one point of it the glyph's own bearing).
|
|
138
|
+
"config.window_padding = { left = '10pt', right = '10pt', top = 2, bottom = 2 }",
|
|
124
139
|
'config.hide_tab_bar_if_only_one_tab = true',
|
|
125
140
|
'config.enable_scroll_bar = false',
|
|
126
141
|
// Terminal.app does not ask before closing a window whose process is tmux (its default "ask before closing" list).
|