@@ -11,6 +11,7 @@ export enum Shell {
11
11
PowerShellCore = 'PowerShell Core' ,
12
12
Kitty = 'Kitty' ,
13
13
Alacritty = 'Alacritty' ,
14
+ WezTerm = 'WezTerm' ,
14
15
}
15
16
16
17
export const Default = Shell . Terminal
@@ -33,6 +34,8 @@ function getBundleID(shell: Shell): string {
33
34
return 'net.kovidgoyal.kitty'
34
35
case Shell . Alacritty :
35
36
return 'io.alacritty'
37
+ case Shell . WezTerm :
38
+ return 'com.github.wez.wezterm'
36
39
default :
37
40
return assertNever ( shell , `Unknown shell: ${ shell } ` )
38
41
}
@@ -58,13 +61,15 @@ export async function getAvailableShells(): Promise<
58
61
powerShellCorePath ,
59
62
kittyPath ,
60
63
alacrittyPath ,
64
+ wezTermPath ,
61
65
] = await Promise . all ( [
62
66
getShellPath ( Shell . Terminal ) ,
63
67
getShellPath ( Shell . Hyper ) ,
64
68
getShellPath ( Shell . iTerm2 ) ,
65
69
getShellPath ( Shell . PowerShellCore ) ,
66
70
getShellPath ( Shell . Kitty ) ,
67
71
getShellPath ( Shell . Alacritty ) ,
72
+ getShellPath ( Shell . WezTerm ) ,
68
73
] )
69
74
70
75
const shells : Array < IFoundShell < Shell > > = [ ]
@@ -94,6 +99,11 @@ export async function getAvailableShells(): Promise<
94
99
shells . push ( { shell : Shell . Alacritty , path : alacrittyExecutable } )
95
100
}
96
101
102
+ if ( wezTermPath ) {
103
+ const wezTermExecutable = `${ wezTermPath } /Contents/MacOS/wezterm`
104
+ shells . push ( { shell : Shell . WezTerm , path : wezTermExecutable } )
105
+ }
106
+
97
107
return shells
98
108
}
99
109
@@ -115,6 +125,12 @@ export function launch(
115
125
// It uses --working-directory command to start the shell
116
126
// in the specified working directory.
117
127
return spawn ( foundShell . path , [ '--working-directory' , path ] )
128
+ } else if ( foundShell . shell === Shell . WezTerm ) {
129
+ // WezTerm, like Alacritty, "cannot open files in the 'folder' format."
130
+ //
131
+ // It uses the subcommand `start`, followed by the option `--cwd` to set
132
+ // the working directory, followed by the path.
133
+ return spawn ( foundShell . path , [ 'start' , '--cwd' , path ] )
118
134
} else {
119
135
const bundleID = getBundleID ( foundShell . shell )
120
136
return spawn ( 'open' , [ '-b' , bundleID , path ] )
0 commit comments