mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-18 10:30:01 +00:00
commit
5360b2f292
@ -18,11 +18,25 @@ export class WSLShellProvider extends ShellProvider {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bashPath = `${process.env.windir}\\system32\\bash.exe`
|
||||||
const wslPath = `${process.env.windir}\\system32\\wsl.exe`
|
const wslPath = `${process.env.windir}\\system32\\wsl.exe`
|
||||||
const wslConfigPath = `${process.env.windir}\\system32\\wslconfig.exe`
|
const wslConfigPath = `${process.env.windir}\\system32\\wslconfig.exe`
|
||||||
|
|
||||||
if (!await fs.exists(wslPath)) {
|
if (!await fs.exists(wslPath)) {
|
||||||
|
if (await fs.exists(bashPath)) {
|
||||||
|
return [{
|
||||||
|
id: 'wsl',
|
||||||
|
name: 'WSL / Bash on Windows',
|
||||||
|
command: bashPath,
|
||||||
|
env: {
|
||||||
|
TERM: 'xterm-color',
|
||||||
|
COLORTERM: 'truecolor',
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let lines = (await exec(`${wslConfigPath} /l`, { encoding: 'ucs2' }))[0].toString().split('\n').splice(1)
|
let lines = (await exec(`${wslConfigPath} /l`, { encoding: 'ucs2' }))[0].toString().split('\n').splice(1)
|
||||||
let shells: IShell[] = [{
|
let shells: IShell[] = [{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user