From 5fa3eb2f95c8939dbb98d7bf7157f50c988522e2 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:23:19 +0000 Subject: [PATCH] fix(@angular/cli): set process title when running architect commands When running an Architect command for a specific project, the process title is now updated to include the project's name. This provides better visibility in process lists, making it easier to identify which project is being built or served, especially in multi-project workspaces. The original process title is restored after the command finishes execution. Closes #31110 --- .../command-builder/architect-command-module.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/angular/cli/src/command-builder/architect-command-module.ts b/packages/angular/cli/src/command-builder/architect-command-module.ts index 4855b629b360..4218c6274521 100644 --- a/packages/angular/cli/src/command-builder/architect-command-module.ts +++ b/packages/angular/cli/src/command-builder/architect-command-module.ts @@ -97,11 +97,17 @@ export abstract class ArchitectCommandModule } async run(options: Options & OtherOptions): Promise { - const target = this.getArchitectTarget(); + const originalProcessTitle = process.title; + try { + const target = this.getArchitectTarget(); + const { configuration = '', project, ...architectOptions } = options; - const { configuration = '', project, ...architectOptions } = options; + if (project) { + process.title = `${originalProcessTitle} (${project})`; + + return await this.runSingleTarget({ configuration, target, project }, architectOptions); + } - if (!project) { // This runs each target sequentially. // Running them in parallel would jumble the log messages. let result = 0; @@ -111,12 +117,13 @@ export abstract class ArchitectCommandModule } for (const project of projectNames) { + process.title = `${originalProcessTitle} (${project})`; result |= await this.runSingleTarget({ configuration, target, project }, architectOptions); } return result; - } else { - return await this.runSingleTarget({ configuration, target, project }, architectOptions); + } finally { + process.title = originalProcessTitle; } }