Skip to content
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

Add configuration to enable/disable banner #2398

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,11 @@
"type": "boolean",
"description": "Use the vscode API to clear the terminal since that's the only reliable way to clear the scrollback buffer. Turn this on if you're use to 'Clear-Host' clearing scroll history as wellclear-terminal-via-lsp."
},
"powershell.integratedConsole.suppressStartupBanner": {
"type": "boolean",
"default": false,
"description": "Do not show the Powershell Integrated Console banner on launch"
},
"powershell.debugging.createTemporaryIntegratedConsole": {
"type": "boolean",
"default": false,
Expand Down
5 changes: 5 additions & 0 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,17 @@ export class SessionManager implements Middleware {
}
}

const startupBanner = this.sessionSettings.integratedConsole.suppressStartupBanner
? ""
: "`n`n =====> PowerShell Integrated Console <=====`n`n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the default? We should just let PSES have this string, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it to be explicit in case we want to change it in future. On the other hand the duplication isn't ideal and I really don't like needing to write a PowerShell string literal in JS.

Hmmm, ok I'm convinced we should leave it as a the default now.

If we wanted to make it something like ==> VSCode PowerShell Extension <== later, I'd imagine us doing it in the client. But for now I think I agree that leaving it unset in the default case is best.


this.editorServicesArgs =
`-HostName 'Visual Studio Code Host' ` +
`-HostProfileId 'Microsoft.VSCode' ` +
`-HostVersion '${this.HostVersion}' ` +
`-AdditionalModules @('PowerShellEditorServices.VSCode') ` +
`-BundledModulesPath '${PowerShellProcess.escapeSingleQuotes(this.bundledModulesPath)}' ` +
`-StartupBanner "${startupBanner}" ` +
`-EnableConsoleRepl `;

if (this.sessionSettings.developer.editorServicesWaitForDebugger) {
Expand Down
1 change: 1 addition & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface IIntegratedConsoleSettings {
focusConsoleOnExecute?: boolean;
useLegacyReadLine?: boolean;
forceClearScrollbackBuffer?: boolean;
suppressStartupBanner?: boolean;
}

export interface ISideBarSettings {
Expand Down