PowerShell / PowerShell/vscode-powershell
Feature Request: Make the PowerShell Extension profile available as a profile.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.9k
- Forks
- 548
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
Summary
Hello,
I am not good enough with TypeScript/JavaScript to say that I would be able to help actually implement it, but I would like to help if possible.
Currently the extension creates a terminal window and passes the startup scripts to the terminal in code. I would like to propose the idea of fully integrating the terminal created by the extension as.
This would add the following benefits:
- Users would the ability to have the PowerShell Extension show as one or more profiles in the profile selector.
- Users can select the PowerShell Extension profile as their default profile in the profile selector.
- Users can pass arguments to the PowerShell profile at runtime.
- Make it easier to work with sessions.
- Existing command workbench.action.terminal.relaunch could be used in place of PowerShell.RestartSession
Users would be able to configure the profile by adding the profile Json to their settings.
{
"terminal.integrated.profiles.windows": {
"PowerShell Extension": {
"title": "PowerShell Extension",
"env": {
"${env:Example}": "Test"
},
"overrideName": false,
"args": [],
"id": "ms-vscode.powershell.PowerShell-Extension",
"extensionIdentifier": "ms-vscode.powershell"
}
}
}
Proposed Design
The way this could be implemented is by adding in the code to have the extension be a terminal provider. Example below taken from the VSCode API reference.
Contribute a terminal profile to VS Code, allowing extensions to handle the creation of the profiles. When defined, the profile should appear when creating the terminal profile.
{
"activationEvents": [
"onTerminalProfile:my-ext.terminal-profile"
],
"contributes": {
"terminal": {
"profiles": [
{
"title": "Profile from extension",
"id": "my-ext.terminal-profile"
}
]
},
}
}
When defined, the profile will show up in the terminal profile selector. When activated, handle the creation of the profile by returning terminal options:
vscode.window.registerTerminalProfileProvider('my-ext.terminal-profile', {
provideProfileOptions(token: vscode.CancellationToken): vscode.ProviderResult<vscode.TerminalOptions | vscode.ExtensionTerminalOptions> {
return {
name: 'Profile from extension',
shellPath: 'bash'
};
}
});
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die aktuelle Erstellung von Terminals und die Verarbeitung von Startskripten der Erweiterung zu lesen, und vergleiche sie anschließend mit den hier beschriebenen APIs contributes.terminal und registerTerminalProfileProvider von VS Code. Als erledigt gilt die Aufgabe, wenn die Erweiterung in der Auswahl für Terminalprofile erscheint, Konfiguration und Laufzeitargumente unterstützt und den standardmäßigen Ablauf zum erneuten Starten des Terminals verwenden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell, typescript, vscode
- Bereich
- cli, developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100