@@ -21,6 +21,9 @@ interface SpawnArgs {
21
21
args ?: string [ ] ;
22
22
options ?: SpawnOptions ;
23
23
skipStartupScripts ?: true ;
24
+ envVars : {
25
+ [ key : string ] : string ;
26
+ } ;
24
27
}
25
28
26
29
const getTerminalCommand = _ . memoize ( async ( ) : Promise < SpawnArgs | null > => {
@@ -80,6 +83,7 @@ const getLinuxTerminalCommand = async (): Promise<SpawnArgs | null> => {
80
83
const defaultTerminal = gSettingsTerminalKey && gSettingsTerminalKey . getValue ( ) ;
81
84
if ( defaultTerminal && await commandExists ( defaultTerminal ) ) {
82
85
if ( defaultTerminal . includes ( 'gnome-terminal' ) ) return getGnomeTerminalCommand ( defaultTerminal ) ;
86
+ if ( defaultTerminal . includes ( 'kgx' ) ) return getKgxCommand ( defaultTerminal ) ;
83
87
if ( defaultTerminal . includes ( 'konsole' ) ) return getKonsoleTerminalCommand ( defaultTerminal ) ;
84
88
if ( defaultTerminal . includes ( 'xfce4-terminal' ) ) return getXfceTerminalCommand ( defaultTerminal ) ;
85
89
if ( defaultTerminal . includes ( 'x-terminal-emulator' ) ) return getXTerminalCommand ( defaultTerminal ) ;
@@ -91,7 +95,7 @@ const getLinuxTerminalCommand = async (): Promise<SpawnArgs | null> => {
91
95
// If a specific term like this is installed, it's probably the preferred one
92
96
if ( await commandExists ( 'konsole' ) ) return getKonsoleTerminalCommand ( ) ;
93
97
if ( await commandExists ( 'xfce4-terminal' ) ) return getXfceTerminalCommand ( ) ;
94
- if ( await commandExists ( 'kgx' ) ) return { command : 'kgx' } ;
98
+ if ( await commandExists ( 'kgx' ) ) return getKgxCommand ( ) ;
95
99
if ( await commandExists ( 'kitty' ) ) return { command : 'kitty' } ;
96
100
if ( await commandExists ( 'urxvt' ) ) return { command : 'urxvt' } ;
97
101
if ( await commandExists ( 'rxvt' ) ) return { command : 'rxvt' } ;
@@ -136,6 +140,10 @@ const getXTerminalCommand = async (command = 'x-terminal-emulator'): Promise<Spa
136
140
return { command } ;
137
141
} ;
138
142
143
+ const getKgxCommand = async ( command = 'kgx' ) : Promise < SpawnArgs > => {
144
+ return { command, envVars : { DBUS_SESSION_BUS_ADDRESS : '' } } ;
145
+ } ;
146
+
139
147
const getKonsoleTerminalCommand = async ( command = 'konsole' ) : Promise < SpawnArgs > => {
140
148
let extraArgs : string [ ] = [ ] ;
141
149
@@ -207,7 +215,7 @@ export class FreshTerminalInterceptor implements Interceptor {
207
215
const terminalSpawnArgs = await getTerminalCommand ( ) ;
208
216
if ( ! terminalSpawnArgs ) throw new Error ( 'Could not find a suitable terminal' ) ;
209
217
210
- const { command, args, options, skipStartupScripts } = terminalSpawnArgs ;
218
+ const { command, args, options, skipStartupScripts, envVars } = terminalSpawnArgs ;
211
219
212
220
// Our PATH override below may not work, e.g. because OSX's path_helper always prepends
213
221
// the real paths over the top, and git-bash ignore env var paths overrides. To fix this,
@@ -230,6 +238,7 @@ export class FreshTerminalInterceptor implements Interceptor {
230
238
env : {
231
239
...currentEnv ,
232
240
...getTerminalEnvVars ( proxyPort , this . config . https , currentEnv ) ,
241
+ ...envVars ,
233
242
} ,
234
243
cwd : currentEnv . HOME || currentEnv . USERPROFILE
235
244
} )
0 commit comments