Skip to content

Display preview state and version info in PSIC startup banner #2644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export function activate(context: vscode.ExtensionContext): void {
requiredEditorServicesVersion,
logger,
documentSelector,
PackageJSON.displayName,
PackageJSON.version,
telemetryReporter);

Expand Down
9 changes: 8 additions & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export enum SessionStatus {
}

export class SessionManager implements Middleware {
public HostName: string;
public HostVersion: string;
public PowerShellExeDetails: IPowerShellExeDetails;
private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu";
Expand Down Expand Up @@ -68,11 +69,13 @@ export class SessionManager implements Middleware {
private requiredEditorServicesVersion: string,
private log: Logger,
private documentSelector: DocumentSelector,
private hostName: string,
private version: string,
private reporter: TelemetryReporter) {

this.platformDetails = getPlatformDetails();

this.HostName = hostName;
this.HostVersion = version;
this.telemetryReporter = reporter;

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

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

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

if (this.sessionSettings.integratedConsole.suppressStartupBanner) {
this.editorServicesArgs += "-StartupBanner '' ";
} else {
const startupBanner = `=====> ${this.HostName} Integrated Console v${this.HostVersion} <=====
`;
this.editorServicesArgs += `-StartupBanner "${startupBanner}" `;
}

if (this.sessionSettings.developer.editorServicesWaitForDebugger) {
Expand Down