Skip to content

Commit 52d5d17

Browse files
committed
Pass in displayName to SessionMgr, adjust banner whitespace
1 parent 8014d52 commit 52d5d17

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/main.ts

Lines changed: 1 addition & 0 deletions
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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import fs = require("fs");
66
import net = require("net");
7+
import * as os from "os";
78
import path = require("path");
89
import * as semver from "semver";
910
import vscode = require("vscode");
@@ -35,6 +36,7 @@ export enum SessionStatus {
3536
}
3637

3738
export class SessionManager implements Middleware {
39+
public HostName: string;
3840
public HostVersion: string;
3941
public PowerShellExeDetails: IPowerShellExeDetails;
4042
private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu";
@@ -68,11 +70,13 @@ export class SessionManager implements Middleware {
6870
private requiredEditorServicesVersion: string,
6971
private log: Logger,
7072
private documentSelector: DocumentSelector,
73+
private hostName: string,
7174
private version: string,
7275
private reporter: TelemetryReporter) {
7376

7477
this.platformDetails = getPlatformDetails();
7578

79+
this.HostName = hostName;
7680
this.HostVersion = version;
7781
this.telemetryReporter = reporter;
7882

@@ -81,7 +85,7 @@ export class SessionManager implements Middleware {
8185

8286
this.log.write(
8387
`Visual Studio Code v${vscode.version} ${procBitness}`,
84-
`PowerShell Extension v${this.HostVersion}`,
88+
`${this.HostName} Extension v${this.HostVersion}`,
8589
`Operating System: ${OperatingSystem[this.platformDetails.operatingSystem]} ${osBitness}`);
8690

8791
// Fix the host version so that PowerShell can consume it.
@@ -192,15 +196,7 @@ export class SessionManager implements Middleware {
192196
if (this.sessionSettings.integratedConsole.suppressStartupBanner) {
193197
this.editorServicesArgs += "-StartupBanner '' ";
194198
} else {
195-
const packageJSON: any = require("../../package.json");
196-
const previewStr = (packageJSON.name.toLowerCase() === "powershell-preview") ? "Preview " : "";
197-
198-
const startupBanner = `
199-
200-
=====> PowerShell ${previewStr}Integrated Console v${this.HostVersion} <=====
201-
202-
`;
203-
199+
const startupBanner = `=====> ${this.HostName} Integrated Console v${this.HostVersion} <=====${os.EOL}`;
204200
this.editorServicesArgs += `-StartupBanner "${startupBanner}" `;
205201
}
206202

0 commit comments

Comments
 (0)