Skip to content

Commit

Permalink
fix(plugins/plugin-bash-like): add back configurable shell
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanqiu Zhang authored and starpit committed May 12, 2020
1 parent 0e3a030 commit 51b2270
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions plugins/plugin-bash-like/src/pty/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,14 @@ export const getLoginShell = (): Promise<string> => {
export async function getShellOpts(): Promise<Shell> {
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
}
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/plugin-client-default/config.d/proxy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"needleOptions": {
"rejectUnauthorized": false
}
}
},
"shellExe": "",
"shellOpts": []
}

0 comments on commit 51b2270

Please sign in to comment.