From a1b438cea6aec91726c526e263ea5d32079356b5 Mon Sep 17 00:00:00 2001 From: Asem Dreibati Date: Tue, 29 Oct 2024 10:31:57 +0300 Subject: [PATCH 01/13] Store the DI decorator's id in specific property (#5131). --- src/common/services/InstantiationService.ts | 2 +- src/common/services/ServiceRegistry.ts | 2 +- src/common/services/Services.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/services/InstantiationService.ts b/src/common/services/InstantiationService.ts index 375e442d..7e769548 100644 --- a/src/common/services/InstantiationService.ts +++ b/src/common/services/InstantiationService.ts @@ -67,7 +67,7 @@ export class InstantiationService implements IInstantiationService { for (const dependency of serviceDependencies) { const service = this._services.get(dependency.id); if (!service) { - throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`); + throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id._id}.`); } serviceArgs.push(service); } diff --git a/src/common/services/ServiceRegistry.ts b/src/common/services/ServiceRegistry.ts index 6510fb8e..7d887bc6 100644 --- a/src/common/services/ServiceRegistry.ts +++ b/src/common/services/ServiceRegistry.ts @@ -33,7 +33,7 @@ export function createDecorator(id: string): IServiceIdentifier { storeServiceDependency(decorator, target, index); }; - decorator.toString = () => id; + decorator._id = id; serviceRegistry.set(id, decorator); return decorator; diff --git a/src/common/services/Services.ts b/src/common/services/Services.ts index 0ceff36c..9d5ca64b 100644 --- a/src/common/services/Services.ts +++ b/src/common/services/Services.ts @@ -124,6 +124,7 @@ export interface ICharsetService { export interface IServiceIdentifier { (...args: any[]): void; type: T; + _id: string; } export interface IBrandedService { From 9f9bb3c11c0d6d88c4d9d16ce70e9e1f3be73038 Mon Sep 17 00:00:00 2001 From: An Phi Date: Wed, 18 Dec 2024 01:26:47 -0500 Subject: [PATCH 02/13] bug: properly render the terminal when open() is called again --- src/browser/CoreBrowserTerminal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/CoreBrowserTerminal.ts b/src/browser/CoreBrowserTerminal.ts index 2e15b5f3..33ee94bc 100644 --- a/src/browser/CoreBrowserTerminal.ts +++ b/src/browser/CoreBrowserTerminal.ts @@ -400,7 +400,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal { } // If the terminal is already opened - if (this.element?.ownerDocument.defaultView && this._coreBrowserService) { + if (this.element?.ownerDocument.defaultView && this._coreBrowserService && this.element?.isConnected) { // Adjust the window if needed if (this.element.ownerDocument.defaultView !== this._coreBrowserService.window) { this._coreBrowserService.window = this.element.ownerDocument.defaultView; From ef67b42fbd80a584f3897c5614cda8bf13ffadc9 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:59:00 -0800 Subject: [PATCH 03/13] Demo test button for common ligatures Part of #5231 --- demo/client.ts | 13 +++++++++++++ demo/index.html | 3 +++ 2 files changed, 16 insertions(+) diff --git a/demo/client.ts b/demo/client.ts index f7503210..7a1ac72b 100644 --- a/demo/client.ts +++ b/demo/client.ts @@ -240,6 +240,7 @@ if (document.location.pathname === '/test') { document.getElementById('add-decoration').addEventListener('click', addDecoration); document.getElementById('add-overview-ruler').addEventListener('click', addOverviewRuler); document.getElementById('decoration-stress-test').addEventListener('click', decorationStressTest); + document.getElementById('ligatures-test').addEventListener('click', ligaturesTest); document.getElementById('weblinks-test').addEventListener('click', testWeblinks); document.getElementById('bce').addEventListener('click', coloredErase); addVtButtons(); @@ -1307,6 +1308,18 @@ function addVtButtons(): void { document.querySelector('#vt-container').appendChild(vtFragment); } +function ligaturesTest(): void { + term.write([ + '', + '-<< -< -<- <-- <--- <<- <- -> ->> --> ---> ->- >- >>-', + '=<< =< =<= <== <=== <<= <= => =>> ==> ===> =>= >= >>=', + '<-> <--> <---> <----> <=> <==> <===> <====> :: ::: __', + '<~~ /> ~~> == != /= ~= <> === !== !=== =/= =!=', + '<: := *= *+ <* <*> *> <| <|> |> <. <.> .> +* =* =: :>', + '(* *) /* */ [| |] {| |} ++ +++ \/ /\ |- -| <---> <----> <=> <==> <===> <====> :: ::: __', '<~~ /> ~~> == != /= ~= <> === !== !=== =/= =!=', '<: := *= *+ <* <*> *> <| <|> |> <. <.> .> +* =* =: :>', - '(* *) /* */ [| |] {| |} ++ +++ \/ /\ |- -|