Skip to content

Commit 79d7313

Browse files
authored
Display preview state and version info in PSIC startup banner (#2644)
* Display preview status and version info in the PSIC startup banner * Use the existing this.HostVersion for version info * Pass in displayName to SessionMgr, adjust banner whitespace * Add some leading whitespace to startup banner * Go with whitespace option #5 - less is more :-)
1 parent c6ccc68 commit 79d7313

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export function activate(context: vscode.ExtensionContext): void {
136136
requiredEditorServicesVersion,
137137
logger,
138138
documentSelector,
139+
PackageJSON.displayName,
139140
PackageJSON.version,
140141
telemetryReporter);
141142

src/session.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export enum SessionStatus {
3535
}
3636

3737
export class SessionManager implements Middleware {
38+
public HostName: string;
3839
public HostVersion: string;
3940
public PowerShellExeDetails: IPowerShellExeDetails;
4041
private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu";
@@ -68,11 +69,13 @@ export class SessionManager implements Middleware {
6869
private requiredEditorServicesVersion: string,
6970
private log: Logger,
7071
private documentSelector: DocumentSelector,
72+
private hostName: string,
7173
private version: string,
7274
private reporter: TelemetryReporter) {
7375

7476
this.platformDetails = getPlatformDetails();
7577

78+
this.HostName = hostName;
7679
this.HostVersion = version;
7780
this.telemetryReporter = reporter;
7881

@@ -81,7 +84,7 @@ export class SessionManager implements Middleware {
8184

8285
this.log.write(
8386
`Visual Studio Code v${vscode.version} ${procBitness}`,
84-
`PowerShell Extension v${this.HostVersion}`,
87+
`${this.HostName} Extension v${this.HostVersion}`,
8588
`Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}`);
8689

8790
// Fix the host version so that PowerShell can consume it.
@@ -191,6 +194,10 @@ export class SessionManager implements Middleware {
191194

192195
if (this.sessionSettings.integratedConsole.suppressStartupBanner) {
193196
this.editorServicesArgs += "-StartupBanner '' ";
197+
} else {
198+
const startupBanner = `=====> ${this.HostName} Integrated Console v${this.HostVersion} <=====
199+
`;
200+
this.editorServicesArgs += `-StartupBanner "${startupBanner}" `;
194201
}
195202

196203
if (this.sessionSettings.developer.editorServicesWaitForDebugger) {

0 commit comments

Comments
 (0)