Skip to content

Commit 312a24c

Browse files
Terminal: Disable bold, tweak line height (#3215)
**Line Height** In xterm.js, `lineHeight` is a multiplier on the *measured* cell height, not the font size. So a `lineHeight` of 1 is actually closer to what we'd expect here. **Bold** There seems to be a bug where setting bold makes the cell width wider. Not sure if this is on `xterm.js` or its the font metrics. Better instead to just disable bold. Before: <img width="320" height="419" alt="image" src="https://github.com/user-attachments/assets/a65cc31c-6f01-4065-8825-291007e424fb" /> After: <img width="315" height="350" alt="image" src="https://github.com/user-attachments/assets/8dd5ce6e-ee9e-41fb-b964-d58620aacc2d" />
1 parent 8bd53c4 commit 312a24c

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

app/components/Terminal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ function getOptions(): ITerminalOptions {
5757
screenReaderMode: true,
5858
fontFamily: '"GT America Mono", monospace',
5959
fontSize: 13,
60-
lineHeight: 1.2,
60+
lineHeight: 1,
61+
fontWeightBold: 400,
62+
drawBoldTextInBrightColors: true,
63+
letterSpacing: 0,
6164
windowOptions: {
6265
fullscreenWin: true,
6366
refreshWin: true,

app/ui/styles/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,7 @@
281281
display: none;
282282
}
283283
}
284+
285+
.xterm-bold {
286+
-webkit-text-stroke: 0.75px currentColor;
287+
}

mock-api/serial-console.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,27 @@ Terminal theme test:
22
red green yellow blue magenta cyan white
33
bright-red bright-green bright-yellow bright-blue bright-magenta bright-cyan bright-white bright-black
44

5+
Bold A Bold A
6+
Bold A Bold A
7+
58
Booting `Debian GNU/Linux'
69

10+
(
11+
. ) .
12+
~. . ( . .~
13+
~_ '._.-'''-._.' _~
14+
'~..' '..~'
15+
~~._ / \ _.~~
16+
;/____\ /____\;
17+
~~~~~~~|` ) ( `|~~~~~~~
18+
_: ( ) ;_
19+
~~' \ / '~~
20+
_.~''. ~~~ .''~._
21+
~ .''-.....-''. ~
22+
~' ' ) ' '~
23+
' ( '
24+
)
25+
726
Loading Linux 6.12.38+deb13-amd64 ...
827
Loading initial ramdisk ...
928
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
@@ -138,4 +157,4 @@ Welcome to Debian GNU/Linux 13 (trixie)!
138157

139158
Debian GNU/Linux 13 oxide-instance ttyS0
140159

141-
oxide-instance login:
160+
oxide-instance login:

0 commit comments

Comments
 (0)