mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): render variable width unicode characters in terminal (#9259)
Previously, characters such as 🟢 were given insufficient space, leading
to mangled output.
This commit is contained in:
@@ -10,6 +10,7 @@ import * as XTerm from "xterm"
|
||||
import { CanvasAddon } from "xterm-addon-canvas"
|
||||
import { FitAddon } from "xterm-addon-fit"
|
||||
import { WebLinksAddon } from "xterm-addon-web-links"
|
||||
import { Unicode11Addon } from "xterm-addon-unicode11"
|
||||
import "xterm/css/xterm.css"
|
||||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
||||
import { pageTitle } from "../../utils/page"
|
||||
@@ -176,6 +177,7 @@ const TerminalPage: FC<TerminalPageProps> = ({ renderer }) => {
|
||||
return
|
||||
}
|
||||
const terminal = new XTerm.Terminal({
|
||||
allowProposedApi: true,
|
||||
allowTransparency: true,
|
||||
disableStdin: false,
|
||||
fontFamily: MONOSPACE_FONT_FAMILY,
|
||||
@@ -191,6 +193,8 @@ const TerminalPage: FC<TerminalPageProps> = ({ renderer }) => {
|
||||
const fitAddon = new FitAddon()
|
||||
setFitAddon(fitAddon)
|
||||
terminal.loadAddon(fitAddon)
|
||||
terminal.loadAddon(new Unicode11Addon())
|
||||
terminal.unicode.activeVersion = "11"
|
||||
terminal.loadAddon(
|
||||
new WebLinksAddon((_, uri) => {
|
||||
handleWebLink(uri)
|
||||
|
||||
Reference in New Issue
Block a user