-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Add Xonsh shell terminal configuration #286707
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds terminal configuration support for the Xonsh shell across Windows, macOS, and Linux platforms, enabling VS Code users to select Xonsh as a terminal profile option.
Key changes:
- Added Xonsh shell profile configurations for all three major platforms (Windows, macOS, and Linux)
- Configured platform-specific executable paths and launch arguments
src/vs/platform/terminal/common/terminalPlatformConfiguration.ts
Outdated
Show resolved
Hide resolved
src/vs/platform/terminal/common/terminalPlatformConfiguration.ts
Outdated
Show resolved
Hide resolved
src/vs/platform/terminal/common/terminalPlatformConfiguration.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Tyriar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the right place to add support, only shells that need some special handling should be included in the setting defaults. Check out the profile discovery code here which would make it show up in the + dropdown:
vscode/src/vs/platform/terminal/node/terminalProfiles.ts
Lines 117 to 142 in b069e34
| detectedProfiles.set('Cygwin', { | |
| path: [ | |
| { path: `${process.env['HOMEDRIVE']}\\cygwin64\\bin\\bash.exe`, isUnsafe: true }, | |
| { path: `${process.env['HOMEDRIVE']}\\cygwin\\bin\\bash.exe`, isUnsafe: true } | |
| ], | |
| args: ['--login'], | |
| isAutoDetected: true | |
| }); | |
| detectedProfiles.set('bash (MSYS2)', { | |
| path: [ | |
| { path: `${process.env['HOMEDRIVE']}\\msys64\\usr\\bin\\bash.exe`, isUnsafe: true }, | |
| ], | |
| args: ['--login', '-i'], | |
| // CHERE_INVOKING retains current working directory | |
| env: { CHERE_INVOKING: '1' }, | |
| icon: Codicon.terminalBash, | |
| isAutoDetected: true | |
| }); | |
| const cmderPath = `${process.env['CMDER_ROOT'] || `${process.env['HOMEDRIVE']}\\cmder`}\\vendor\\bin\\vscode_init.cmd`; | |
| detectedProfiles.set('Cmder', { | |
| path: `${system32Path}\\cmd.exe`, | |
| args: ['/K', cmderPath], | |
| // The path is safe if it was derived from CMDER_ROOT | |
| requiresPath: process.env['CMDER_ROOT'] ? cmderPath : { path: cmderPath, isUnsafe: true }, | |
| isAutoDetected: true | |
| }); |
You should use isUnsafe if it's installed in an unsafe directory that other users would have access to (unless the path is derived from process.env).
Created #286741 so this gets covered in release notes/testing if it gets merged.
|
Also note if this goes into |
|
@Tyriar the general workflow for xonsh is:
So in fact it's enough to implement simple logic: if we have So based on this what do you think? May be we can start from just this: detectedProfiles.set('xonsh', {
path: ['xonsh', 'xonsh.exe'],
isAutoDetected: true
}); |
Removed Xonsh terminal configuration from the platform configuration.
Removed xonsh terminal configuration from the platform settings.
|
@anki-code if it can be anywhere and you want to find on the PATH I think you'll need to handle it similar to git bash where you look up the executable like this: vscode/src/vs/platform/terminal/node/terminalProfiles.ts Lines 302 to 305 in 72a0366
I don't think only including |
|
getGitBashPaths logic looks overloaded for xonsh case. Sorry I lost the path I can implement this... |
|
You need to return valid absolute files here as we're resolving whether it's a valid profile for the system. You wouldn't be doing everything the git bash one does, but basically just the findExecutable bit and resolving the file: vscode/src/vs/platform/terminal/node/terminalProfiles.ts Lines 305 to 309 in efcd799
|
|
@Tyriar what about this? |
Added xonsh shell terminal configuration.
cc #284044
Fixes #286741