Skip to content

Commit

Permalink
Add Julia as Shell type (#225083)
Browse files Browse the repository at this point in the history
* Start adding Julia as Shell type

* remove unncessary

* dont touch original

* add julia.exe to windowsShellHelper & clean up

* remove completed TODO

* format
  • Loading branch information
anthonykim1 authored Aug 9, 2024
1 parent 6aabf62 commit 9b803e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vs/platform/terminal/common/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ export const enum PosixShellType {
Csh = 'csh',
Ksh = 'ksh',
Zsh = 'zsh',
Python = 'python'
Python = 'python',
Julia = 'julia'
}
export const enum WindowsShellType {
CommandPrompt = 'cmd',
PowerShell = 'pwsh',
Wsl = 'wsl',
GitBash = 'gitbash',
Python = 'python'
Python = 'python',
Julia = 'julia'
}
export type TerminalShellType = PosixShellType | WindowsShellType;

Expand Down
3 changes: 3 additions & 0 deletions src/vs/platform/terminal/node/terminalProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const posixShellTypeMap = new Map<string, PosixShellType>([
['sh', PosixShellType.Sh],
['pwsh', PosixShellType.PowerShell],
['python', PosixShellType.Python],
['julia', PosixShellType.Julia],
['zsh', PosixShellType.Zsh]
]);

Expand Down Expand Up @@ -411,6 +412,8 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess

if (sanitizedTitle.toLowerCase().startsWith('python')) {
this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: PosixShellType.Python });
} else if (sanitizedTitle.toLowerCase().startsWith('julia')) {
this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: PosixShellType.Julia });
} else {
this._onDidChangeProperty.fire({ type: ProcessPropertyType.ShellType, value: posixShellTypeMap.get(sanitizedTitle) });
}
Expand Down
2 changes: 2 additions & 0 deletions src/vs/platform/terminal/node/windowsShellHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export class WindowsShellHelper extends Disposable implements IWindowsShellHelpe
case 'bash.exe':
case 'git-cmd.exe':
return WindowsShellType.GitBash;
case 'julia.exe:':
return WindowsShellType.Julia;
case 'wsl.exe':
case 'ubuntu.exe':
case 'ubuntu1804.exe':
Expand Down

0 comments on commit 9b803e9

Please sign in to comment.