As long as we are displaying this banner:
=====> PowerShell Integrated Console <=====
It would be more useful if it displayed this:
=====> PowerShell Preview Integrated Console v2020.4.2 <=====
or
=====> PowerShell Integrated Console v2020.4.0 <=====
I switch between four different computers and on some I use preview and others I use stable. It would be nice to see which I'm using without having to look through my extensions list. I know, first world problems. :-)
@rjmholt added a -StartupBanner to Start-EditorServices recently so this should be pretty trivial to add:
https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs#L202
Add an else to this probably:
https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs#L202
with the Extension name and version.
I take it you are going to take this on, @rkeithhill ? 馃槉 Would be great to see you contributing again!
That's the plan. We'll see how it goes. :-)
I "think" this might be best addressed in the vscode-powershell repo. The question I suppose is what version info should it display? Version info for the extension or version info for PSES? If we do this on the extension side, it is pretty easy e.g.:
if (this.sessionSettings.integratedConsole.suppressStartupBanner) {
this.editorServicesArgs += "-StartupBanner '' ";
} else {
const packageJSON: any = require("../../package.json");
const previewStr = (packageJSON.name.toLowerCase() === "powershell-preview") ? "Preview " : "";
const version = packageJSON.version;
const startupBanner = `
=====> PowerShell ${previewStr}Integrated Console v${version} <=====
`;
this.editorServicesArgs += `-StartupBanner "${startupBanner}" `;
}
If want want to do this on the PSES side, I'm not sure where to get the preview status. The BuildInfo.cs class does have a BuildVersion field but nothing on preview status unless that gets reflected by BuildOrigin when you do a build for publish. Thoughts?
I was thinking this would purely be on the extension side. Just because:
Also I'm pretty sure this.HostVersion gives you the version... and maybe we should have a this.HostName that says PowerShell vs PowerShell Preview
We can probably use this which were this.HostVersion's value originally comes from I believe:
https://github.com/PowerShell/vscode-powershell/blob/master/src/main.ts#L42
I'm gonna transfer this to vscode-powershell.
Any opinion on whether it should be v2020.4.2 or 2020.4.2?
I like it with the v personally :)
Most helpful comment
That's the plan. We'll see how it goes. :-)