1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-26 12:03:31 +03:00

Merge pull request #443 from vsailev/master

Restore Bash on Windows
This commit is contained in:
Eugene 2018-10-03 21:57:36 +01:00 committed by GitHub
commit 5360b2f292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,10 +18,24 @@ export class WSLShellProvider extends ShellProvider {
return []
}
const bashPath = `${process.env.windir}\\system32\\bash.exe`
const wslPath = `${process.env.windir}\\system32\\wsl.exe`
const wslConfigPath = `${process.env.windir}\\system32\\wslconfig.exe`
if (!await fs.exists(wslPath)) {
return []
if (await fs.exists(bashPath)) {
return [{
id: 'wsl',
name: 'WSL / Bash on Windows',
command: bashPath,
env: {
TERM: 'xterm-color',
COLORTERM: 'truecolor',
}
}]
} else {
return []
}
}
let lines = (await exec(`${wslConfigPath} /l`, { encoding: 'ucs2' }))[0].toString().split('\n').splice(1)