Fix Unicode character width rendering using Unicode11Addon in xterm.js [TO FIX #2484] (#5524)

fixes #2484

Co-authored-by: cesarmr-github <167689141+cesarmr-github@users.noreply.github.com>
This commit is contained in:
VoidValue
2026-02-11 16:05:02 -08:00
committed by GitHub
co-authored by cesarmr-github
parent 7c9c56bf51
commit e5a9706d6c
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -52,6 +52,7 @@
"xterm-addon-fit": "^0.5.0",
"xterm-addon-search": "^0.9.0",
"xterm-addon-search-bar": "^0.2.0",
"xterm-addon-unicode11": "^0.6.0",
"xterm-addon-web-links": "^0.6.0",
"yup": "^0.29.1"
},
@@ -4,6 +4,7 @@ import { FitAddon } from 'xterm-addon-fit';
import { SearchAddon } from 'xterm-addon-search';
import { SearchBarAddon } from 'xterm-addon-search-bar';
import { WebLinksAddon } from 'xterm-addon-web-links';
import { Unicode11Addon } from 'xterm-addon-unicode11';
import { ScrollDownHelperAddon } from '@/plugins/XtermScrollDownHelperAddon';
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
import { ServerContext } from '@/state/server';
@@ -59,6 +60,7 @@ export default () => {
const searchAddon = new SearchAddon();
const searchBar = new SearchBarAddon({ searchAddon });
const webLinksAddon = new WebLinksAddon();
const unicode11Addon = new Unicode11Addon();
const scrollDownHelperAddon = new ScrollDownHelperAddon();
const { connected, instance } = ServerContext.useStoreState((state) => state.socket);
const [canSendCommands] = usePermissions(['control.console']);
@@ -127,9 +129,14 @@ export default () => {
terminal.loadAddon(searchAddon);
terminal.loadAddon(searchBar);
terminal.loadAddon(webLinksAddon);
terminal.loadAddon(unicode11Addon);
terminal.loadAddon(scrollDownHelperAddon);
terminal.open(ref.current);
// Activate Unicode 11 for proper emoji and special character width handling
terminal.unicode.activeVersion = '11';
fitAddon.fit();
searchBar.addNewStyle(zIndex);
+5
View File
@@ -9466,6 +9466,11 @@ xterm-addon-search@^0.9.0:
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.9.0.tgz#95278ebb818cfcf882209ae75be96e0bea5d52a5"
integrity sha512-aoolI8YuHvdGw+Qjg8g2M4kst0v86GtB7WeBm4F0jNXA005/6QbWWy9eCsvnIDLJOFI5JSSrZnD6CaOkvBQYPA==
xterm-addon-unicode11@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.6.0.tgz#733fd17bdf2ae6e818493db1d41241c999de0786"
integrity sha512-5pkb8YoS/deRtNqQRw8t640mu+Ga8B2MG3RXGQu0bwgcfr8XiXIRI880TWM49ICAHhTmnOLPzIIBIjEnCq7k2A==
xterm-addon-web-links@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.6.0.tgz#0296cb6c99588847894670d998c9ea6a6aeb26ee"