diff --git a/plugins/plugin-bash-like/src/pty/server.ts b/plugins/plugin-bash-like/src/pty/server.ts index 61a42367359..ada771a04b6 100755 --- a/plugins/plugin-bash-like/src/pty/server.ts +++ b/plugins/plugin-bash-like/src/pty/server.ts @@ -192,10 +192,14 @@ export const getLoginShell = (): Promise => { export async function getShellOpts(): Promise { const kuirc = (await import('./kuirc')).default const bashShellOpts = process.platform === 'win32' ? undefined : ['--rcfile', await kuirc, '-i', '-c', '--'] - const shellOpts = process.platform === 'win32' ? [] : bashShellOpts + const { shellExe: s, shellOpts: o } = await import('@kui-shell/client/config.d/proxy.json').catch(() => { + return { shellExe: '', shellOpts: [] } + }) + const shellExe = s || (process.platform === 'win32' ? 'powershell.exe' : '/bin/bash') + const shellOpts = o && Array.isArray(o) && o.length > 0 ? o : process.platform === 'win32' ? [] : bashShellOpts return { - shellExe: process.platform === 'win32' ? 'powershell.exe' : '/bin/bash', + shellExe, shellOpts } } diff --git a/plugins/plugin-client-default/config.d/proxy.json b/plugins/plugin-client-default/config.d/proxy.json index d8360f09e52..604ab716043 100644 --- a/plugins/plugin-client-default/config.d/proxy.json +++ b/plugins/plugin-client-default/config.d/proxy.json @@ -5,5 +5,7 @@ "needleOptions": { "rejectUnauthorized": false } - } + }, + "shellExe": "", + "shellOpts": [] }