Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html: Add Unicode 11 xterm.js addon #1310

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@xterm/addon-canvas": "^0.6.0",
"@xterm/addon-fit": "^0.9.0",
"@xterm/addon-image": "^0.7.0",
"@xterm/addon-unicode11": "^0.7.0",
"@xterm/addon-web-links": "^0.10.0",
"@xterm/addon-webgl": "^0.17.0",
"@xterm/xterm": "^5.4.0",
Expand Down
1 change: 1 addition & 0 deletions html/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const clientOptions = {
enableTrzsz: false,
enableSixel: false,
isWindows: false,
unicodeVersion: '11',
} as ClientOptions;
const termOptions = {
fontSize: 13,
Expand Down
17 changes: 17 additions & 0 deletions html/src/components/terminal/xterm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { WebglAddon } from '@xterm/addon-webgl';
import { FitAddon } from '@xterm/addon-fit';
import { WebLinksAddon } from '@xterm/addon-web-links';
import { ImageAddon } from '@xterm/addon-image';
import { Unicode11Addon } from '@xterm/addon-unicode11';
import { OverlayAddon } from './addons/overlay';
import { ZmodemAddon } from './addons/zmodem';

Expand Down Expand Up @@ -46,6 +47,7 @@ export interface ClientOptions {
titleFixed?: string;
isWindows: boolean;
trzszDragInitTimeout: number;
unicodeVersion: string;
}

export interface FlowControl {
Expand Down Expand Up @@ -386,6 +388,21 @@ export class Xterm {
case 'isWindows':
if (value) console.log('[ttyd] is windows');
break;
case 'unicodeVersion':
switch (value) {
case 6:
case '6':
console.log('[ttyd] setting Unicode version: 6');
break;
case 11:
case '11':
default:
console.log('[ttyd] setting Unicode version: 11');
terminal.loadAddon(new Unicode11Addon());
terminal.unicode.activeVersion = '11';
break;
}
break;
default:
console.log(`[ttyd] option: ${key}=${JSON.stringify(value)}`);
if (terminal.options[key] instanceof Object) {
Expand Down
10 changes: 10 additions & 0 deletions html/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,15 @@ __metadata:
languageName: node
linkType: hard

"@xterm/addon-unicode11@npm:^0.7.0":
version: 0.7.0
resolution: "@xterm/addon-unicode11@npm:0.7.0"
peerDependencies:
"@xterm/xterm": ^5.0.0
checksum: b8776b6646591ce5c8fa1d413bbd0f0b5c98928877259af97b38ba6d998c2f676d99aaf6dbc173b8d17b9b063bf597be82c5e66d5810a63583b3f0ce262b5a4e
languageName: node
linkType: hard

"@xterm/addon-web-links@npm:^0.10.0":
version: 0.10.0
resolution: "@xterm/addon-web-links@npm:0.10.0"
Expand Down Expand Up @@ -10052,6 +10061,7 @@ __metadata:
"@xterm/addon-canvas": ^0.6.0
"@xterm/addon-fit": ^0.9.0
"@xterm/addon-image": ^0.7.0
"@xterm/addon-unicode11": ^0.7.0
"@xterm/addon-web-links": ^0.10.0
"@xterm/addon-webgl": ^0.17.0
"@xterm/xterm": ^5.4.0
Expand Down
Loading
Loading