Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(site): render variable width unicode characters in terminal
Previously, characters such as 🟢 were given insufficient space, leading
to mangled output.
  • Loading branch information
ammario committed Aug 23, 2023
commit 8121e4f79916ce466e2c32e83ca336bb3d5618ae
1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"xterm": "5.2.1",
"xterm-addon-canvas": "0.4.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should canvas addon be removed or is it still being used somewhere?

"xterm-addon-fit": "0.7.0",
"xterm-addon-unicode11": "0.5.0",
"xterm-addon-web-links": "0.8.0",
"yup": "1.2.0"
},
Expand Down
11 changes: 11 additions & 0 deletions site/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions site/src/pages/TerminalPage/TerminalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down