support Solus Linux - fixes #4881

上级 d6e69f5b
......@@ -18,7 +18,14 @@ export class POSIXShellsProvider extends ShellProvider {
if (this.hostApp.platform === Platform.Windows) {
return []
}
return (await fs.readFile('/etc/shells', { encoding: 'utf-8' }))
let shellListPath = '/etc/shells'
try {
await fs.stat(shellListPath)
} catch {
// Solus Linux
shellListPath = '/usr/share/defaults/etc/shells'
}
return (await fs.readFile(shellListPath, { encoding: 'utf-8' }))
.split('\n')
.map(x => x.trim())
.filter(x => x && !x.startsWith('#'))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册