@volter/supercode-teams 0.2.70 → 0.2.71
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 +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.71",
|
|
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
|
@@ -11,6 +11,11 @@ import { join } from 'node:path';
|
|
|
11
11
|
import { TERMINAL_BASIC } from './terminal-basic.mjs';
|
|
12
12
|
|
|
13
13
|
const TERMINAL_FONTS = '/System/Applications/Utilities/Terminal.app/Contents/Resources/Fonts';
|
|
14
|
+
// Where CoreText finds a glyph Terminal.app's face lacks, in its order (CTFontCopyDefaultCascadeListForLanguages for
|
|
15
|
+
// SFMonoTerminal-Regular, then the faces it picked for ⎿ and ⏺ on macOS 26): WezTerm's own fallbacks come after.
|
|
16
|
+
// CoreText's cascade holds a subset of Apple Symbols (.AppleSymbolsFB) that lacks ⎿, which it draws from Hiragino
|
|
17
|
+
// Sans; WezTerm reads the whole face, so Apple Symbols comes after the faces CoreText reached first.
|
|
18
|
+
const MAC_CASCADE = ['Menlo', 'Monaco', 'Courier New', 'Helvetica', 'Lucida Grande', 'PingFang SC', 'Hiragino Sans', 'STIX Two Math', 'Apple Symbols', 'Apple Color Emoji'];
|
|
14
19
|
const ANSI = ['Black', 'Red', 'Green', 'Yellow', 'Blue', 'Magenta', 'Cyan', 'White'];
|
|
15
20
|
|
|
16
21
|
// Runs in osascript's JavaScript for Automation with the Objective-C bridge: no Apple Event is sent, so no automation
|
|
@@ -40,7 +45,7 @@ function run() {
|
|
|
40
45
|
const font = archived('Font');
|
|
41
46
|
return JSON.stringify({
|
|
42
47
|
name, colors,
|
|
43
|
-
font: font && !font.isNil() ? { family: ObjC.unwrap(font.familyName), size: font.pointSize } : null,
|
|
48
|
+
font: font && !font.isNil() ? { family: ObjC.unwrap(font.familyName), size: font.pointSize, lineHeight: $.NSLayoutManager.alloc.init.defaultLineHeightForFont(font), ascender: font.ascender, descender: font.descender } : null,
|
|
44
49
|
widthSpacing: value('FontWidthSpacing'), heightSpacing: value('FontHeightSpacing'),
|
|
45
50
|
cursorType: value('CursorType'), cursorBlink: value('CursorBlink'), optionIsMeta: value('useOptionAsMetaKey'),
|
|
46
51
|
bell: value('Bell'), visualBell: value('VisualBell'), brightBold: value('UseBrightBold'),
|
|
@@ -63,6 +68,7 @@ const lua = (value) => (typeof value === 'string' ? JSON.stringify(value) : Stri
|
|
|
63
68
|
|
|
64
69
|
/** WezTerm's config (Lua) for a window that looks like Terminal.app with `profile` (from terminalAppProfile, or null). */
|
|
65
70
|
export function weztermConfig(profile, { fontDirs = existsSync(TERMINAL_FONTS) ? [TERMINAL_FONTS] : [] } = {}) {
|
|
71
|
+
const mac = fontDirs.length > 0;
|
|
66
72
|
const stored = profile?.colors ?? {};
|
|
67
73
|
// One colour table per appearance: the profile's colour where it stores one, else Basic's for that appearance.
|
|
68
74
|
const scheme = (basic) => {
|
|
@@ -79,7 +85,10 @@ export function weztermConfig(profile, { fontDirs = existsSync(TERMINAL_FONTS) ?
|
|
|
79
85
|
};
|
|
80
86
|
};
|
|
81
87
|
const table = (colors) => `{\n${Object.entries(colors).map(([key, value]) => ` ${key} = ${Array.isArray(value) ? `{ ${value.map(lua).join(', ')} }` : lua(value)},`).join('\n')}\n }`;
|
|
82
|
-
const families = [...new Set([profile?.font?.family
|
|
88
|
+
const families = mac ? [...new Set([profile?.font?.family ?? 'SF Mono Terminal', ...MAC_CASCADE])] : [];
|
|
89
|
+
// A row is AppKit's line height for the face (Terminal.app's), where WezTerm's is the face's ascent plus descent.
|
|
90
|
+
const font = profile?.font;
|
|
91
|
+
const rowScale = font?.lineHeight && font.ascender - font.descender > 0 ? font.lineHeight / (font.ascender - font.descender) : 1;
|
|
83
92
|
const opacity = stored.BackgroundColor?.[3] ?? 1;
|
|
84
93
|
const cursorShape = ['Block', 'Underline', 'Bar'][profile?.cursorType ?? 0] ?? 'Block';
|
|
85
94
|
const composed = !profile?.optionIsMeta;
|
|
@@ -91,10 +100,14 @@ export function weztermConfig(profile, { fontDirs = existsSync(TERMINAL_FONTS) ?
|
|
|
91
100
|
"local appearance = wezterm.gui and wezterm.gui.get_appearance() or 'Dark'",
|
|
92
101
|
"config.colors = appearance:find('Dark') and schemes.dark or schemes.light",
|
|
93
102
|
`config.font_dirs = { ${fontDirs.map(lua).join(', ')} }`,
|
|
94
|
-
`config.font = wezterm.font_with_fallback({ ${families.map(lua).join(', ')} })
|
|
103
|
+
...(families.length ? [`config.font = wezterm.font_with_fallback({ ${families.map(lua).join(', ')} })`] : []),
|
|
104
|
+
// CoreText draws glyphs unhinted; FreeType's default hinting snaps their outlines to the pixel grid.
|
|
105
|
+
"config.freetype_load_flags = 'NO_HINTING'",
|
|
106
|
+
// Box and block characters are the face's own glyphs, as CoreText draws them, not WezTerm's drawn lines.
|
|
107
|
+
'config.custom_block_glyphs = false',
|
|
95
108
|
`config.font_size = ${profile?.font?.size ?? TERMINAL_BASIC.fontSize}`,
|
|
96
109
|
`config.cell_width = ${profile?.widthSpacing ?? 1}`,
|
|
97
|
-
`config.line_height = ${profile?.heightSpacing ?? 1}`,
|
|
110
|
+
`config.line_height = ${Number(((profile?.heightSpacing ?? 1) * rowScale).toFixed(4))}`,
|
|
98
111
|
`config.default_cursor_style = ${lua(`${profile?.cursorBlink ? 'Blinking' : 'Steady'}${cursorShape}`)}`,
|
|
99
112
|
`config.send_composed_key_when_left_alt_is_pressed = ${composed}`,
|
|
100
113
|
`config.send_composed_key_when_right_alt_is_pressed = ${composed}`,
|