4
4
5
5
import fs = require( "fs" ) ;
6
6
import net = require( "net" ) ;
7
+ import * as os from "os" ;
7
8
import path = require( "path" ) ;
8
9
import * as semver from "semver" ;
9
10
import vscode = require( "vscode" ) ;
@@ -35,6 +36,7 @@ export enum SessionStatus {
35
36
}
36
37
37
38
export class SessionManager implements Middleware {
39
+ public HostName : string ;
38
40
public HostVersion : string ;
39
41
public PowerShellExeDetails : IPowerShellExeDetails ;
40
42
private ShowSessionMenuCommandName = "PowerShell.ShowSessionMenu" ;
@@ -68,11 +70,13 @@ export class SessionManager implements Middleware {
68
70
private requiredEditorServicesVersion : string ,
69
71
private log : Logger ,
70
72
private documentSelector : DocumentSelector ,
73
+ private hostName : string ,
71
74
private version : string ,
72
75
private reporter : TelemetryReporter ) {
73
76
74
77
this . platformDetails = getPlatformDetails ( ) ;
75
78
79
+ this . HostName = hostName ;
76
80
this . HostVersion = version ;
77
81
this . telemetryReporter = reporter ;
78
82
@@ -81,7 +85,7 @@ export class SessionManager implements Middleware {
81
85
82
86
this . log . write (
83
87
`Visual Studio Code v${ vscode . version } ${ procBitness } ` ,
84
- `PowerShell Extension v${ this . HostVersion } ` ,
88
+ `${ this . HostName } Extension v${ this . HostVersion } ` ,
85
89
`Operating System: ${ OperatingSystem [ this . platformDetails . operatingSystem ] } ${ osBitness } ` ) ;
86
90
87
91
// Fix the host version so that PowerShell can consume it.
@@ -192,15 +196,7 @@ export class SessionManager implements Middleware {
192
196
if ( this . sessionSettings . integratedConsole . suppressStartupBanner ) {
193
197
this . editorServicesArgs += "-StartupBanner '' " ;
194
198
} 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 } ` ;
204
200
this . editorServicesArgs += `-StartupBanner "${ startupBanner } " ` ;
205
201
}
206
202
0 commit comments